4 ms·
What does double quotes dollar do in the command?
by hi41 7y ago
What does double quotes dollar do in the command?
- MHP47 7y ago$i is the variable i declared in the for loop. Quotes just wraps it, so that it's (somewhat) safe if the file has a space in the name
- majewsky 7y agoWhat do you mean, "somewhat"? This looks safe for all I can tell.
- akx 7y agoEnsures filenames with spaces in them get passed as a single argument, instead of being inadvertently expanded into several. Quoting and expansion issues are a pain in shell languages...
- deleted 7y ago[deleted]
- nickjj 7y agoYou know how you should almost always eat your vegetables? You should almost always quote your Bash variables too. Here's why: https://nickjanetakis.com/blog/here-is-why-you-should-quote-your-variables-in-bash https://nickjanetakis.com/blog/here-is-why-you-should-quote-...
- aoeusnth1 7y agoIt prevents filenames with spaces from expanding into two arguments to the command.