Skip to content

Reading a script before you run it

hardpar 1 command

Guard the script

clean.sh runs rm -rf "$BUILD"/* and nothing sets BUILD. Add the one line that makes it fail instead of emptying this directory, immediately after the shebang. Do not run it to find out.

Goal

0 / 1 commands

clean.sh runs rm -rf "$BUILD"/*, and BUILD is set nowhere. Add set -u immediately after its shebang line, so that it fails instead of emptying the directory. Do not run it.

  • ·Uses sed
  • ·Does not use rm
$

The files in the sandbox, with their modes, link counts and sizes
ModeLinksSizeName
-rwxr-xr-x169clean.sh
-rw-r--r--139notes.txt
-rw-r--r--19report.txt