X-Git-Url: https://sipb.mit.edu/gitweb.cgi/wiki.git/blobdiff_plain/c4eec3730a1306b1ce1881d4d8976fad170630cd..02b1fab21a8fc6416023402338dc26e6491a8fc8:/doc/safe-shell.mdwn?ds=sidebyside diff --git a/doc/safe-shell.mdwn b/doc/safe-shell.mdwn index 7c9bbb3..7b8f601 100644 --- a/doc/safe-shell.mdwn +++ b/doc/safe-shell.mdwn @@ -54,8 +54,7 @@ Disable filename expansion (globbing) upon seeing `*`, `?`, etc.. If your script depends on globbing, you obviously shouldn't set this. Instead, you may find -`[shopt](http://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html) --s failglob` useful, which causes globs that don't get expanded to cause +[`shopt -s failglob`](http://www.gnu.org/software/bash/manual/html_node/The-Shopt-Builtin.html) useful, which causes globs that don't get expanded to cause errors, rather than getting passed to the command with the `*` intact. ### [`set -o pipefail`](http://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html) @@ -102,6 +101,10 @@ manual](http://www.gnu.org/software/bash/manual/html_node/Special-Parameters.htm for details on the distinction between `$*`, `$@`, and `"$@"` — the first and second are rarely what you want in a safe shell script. +## Temporary files + +TODO: mumble `mktemp`? + ## Conclusion When possible, instead of writing a "safe" shell script, *use a higher-level