3 ms·
Wow, eagle eyes. Thank you. Any tips on how to deal with quotes around variable expansions in general? Should I quote each usage of a variable or does it depend
by martinpllu 9y ago
Wow, eagle eyes. Thank you. Any tips on how to deal with quotes around variable expansions in general? Should I quote each usage of a variable or does it depend on context?
- yorwba 9y agoQuoting each usage of a variable is almost always correct. The only context where it isn't correct is when you need word-splitting to occur, which is almost never. Even "$@" is special-cased to do the right thing and quote each individual parameter, instead of the whole list.