3 ms·
Unix shell scripts will break when filenames/paths have spaces if variable expansions are not quoted, resulting in word splitting and filename expansion (globbi
by Anthony-G 3y ago
Unix shell scripts will break when filenames/paths have spaces if variable expansions are not quoted, resulting in word splitting and filename expansion (globbing). This is something that is drilled into learners by all good teachers, e.g., https://mywiki.wooledge.org/Quotes#When_Should_You_Quote.3F https://mywiki.wooledge.org/Quotes#When_Should_You_Quote.3F
- nomel 3y agoWait until you hear about `make`, completely cementing the idea of '_' as space for decades to come [1]! Related, any time I join a new group, that uses bash in any capacity, I introduce them all to the `shellcheck` utility [2], and run a shell script of the person with the largest ego through, as a "demo". [1] https://stackoverflow.com/a/9838604/1487072 https://stackoverflow.com/a/9838604/1487072 [2] Online version: https://www.shellcheck.net/ https://www.shellcheck.net/
- keepamovin 3y agoAwesome! Thanks for introducing me to this. I mean my ego ha