3 weeks ago
Sun Oct 5, 2025 8:19am PST
How to automatically turn any .sh into a dry-run to see what it'll do

  <?php
  $script = file('link_plugins.sh');
  foreach ($script as $line) {
      $trim = trim($line);
      if ($trim === '' || $trim[0] === '#') {
          echo $line; // comments or blank
      } else {
          echo "echo '+ $trim'\n";
      }
  }
  ?>


  php dryrun.php > dryrun.sh
  bash dryrun.sh



Is there a better way?
comments:
add comment
loading comments...