Comment

Comment by ndsipa_pomu

I too often avoid spaces in filenames, but when writing scripts it's far better to ensure that you cope with them properly. The trick is to always quote your variables by default and then run shellcheck on your script so that it can flag up the corner cases where quoting acts to unquote the string. Of course, it'll also flag up a host of other possible issues which are well worth fixing or at least understanding why it's a possible issue.

Another common footgun is not including a double dash ('--') at the end of command options so that the following filename won't be interpreted as an option when it begins with a dash.

parent ndsipa_pomu 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton