September 2018
Beginner
186 pages
4h 30m
English
The previous section might have led you to ask, What about if I actually do want the contents of my variable to undergo whitespace splitting and glob expansion?
You may be tempted to do this to store a set of options for repeated use in later commands, for example:
# Not recommended curlopts='--location --cookie-jar ~/cookies --cookie ~/cookies' curl $curlopts --head -- http://www.example.org/ curl $curlopts -- http://www.example.net/
If we double-quoted the $curlopts expansions here, the options would be treated together as one argument, and wouldn't work correctly. However, this still seems to be a useful property of variables—so how can we use it safely?
The answer is that this is an ideal application of the ...
Read now
Unlock full access