That's so accurate. I used to write shell scripts with
command $1
foo() { for arg in "$@" ; do echo "arg is \"${arg}\"" done } foo 'bar baz' 'spaces in filename.txt'
When writing shell scripts it's a good idea to use the -- option whenever possible
stupid_backup() { cp -a -- "$@" /stupid/backup/dir/ } # copies 2 files stupid_backup --files '-with -leading -dashes'
That's so accurate. I used to write shell scripts with
until I got a few too many nasty surprises with dashes in filenames.