3 ms·
Regarding setting $IFS: for arg in $@; do A better way to do it is to quote it: for arg in "$@"; do because then you can capture newlines and tabs. Bash
by john398053 12y ago
Regarding setting $IFS:
for arg in $@; do
A better way to do it is to quote it:
for arg in "$@"; do
because then you can capture newlines and tabs. Bash will automatically convert it to separate parameters, even though there is only one quoted variable.
- js2 12y agoSee footnote 2. http://redsymbol.net/articles/unofficial-bash-strict-mode/#footnote-2 http://redsymbol.net/articles/unofficial-bash-strict-mode/#f...
- pflanze 12y agoI wonder why not to set IFS='' then. I haven't used this myself in production, but quick testing seems to do what I expected: make $foo behave like "$foo".