Skip to content

Instantly share code, notes, and snippets.

@alexharv074
Created April 29, 2019 02:54
Show Gist options
  • Save alexharv074/1e09d0502516d87ca4ea6805c8611adf to your computer and use it in GitHub Desktop.
Save alexharv074/1e09d0502516d87ca4ea6805c8611adf to your computer and use it in GitHub Desktop.
# test.sh
#!/usr/bin/env bash
for n in aaa bbb ccc ; do
mv $n $n.bak ## Quoting not required if
done ## inputs are known.
for n in ddd/* ; do
mv "$n" "$n.bak" ## Quoting *is* required if
done ## we don't trust the input.
###
▶ shellcheck test.sh ; echo $?
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment