On Thu, Sep 8, 2016 at 7:26 AM, Greg Reagle <greg.rea...@umbc.edu> wrote: > On Thu, Sep 8, 2016, at 10:11 AM, Greg Reagle wrote: >> On Thu, Sep 8, 2016, at 10:05 AM, Kamil Cholewiński wrote: >> > Wow, shell quoting is just fucked up crazy. I was mostly using unquoted >> > $@ my whole life. And here I thought I knew enough not to screw up a >> > simple script, >> >> It is common knowledge to always double-quote $@, i.e. "$@", in >> Bourne/Posix shell. > > At the same time, it is something that everyone has to learn at some > point. We are not born knowing this. There was a time before I knew it > too. So I don't mean to be critical of you personally. >
The problem (as I see it) is that no one takes shell scripting seriously. They never take the time to sit down and study it the way they do for other languages. That and 99% of the scripts you'll find in the wild are pure crap. I'll take this chance to plug the bash guide[0] again. And especially the pitfalls[1] and faq[2]. If you don't want to work through the whole guide (which you should), at least read the pitfalls and faq. [0]http://mywiki.wooledge.org/BashGuide [1]http://mywiki.wooledge.org/BashPitfalls [2]http://mywiki.wooledge.org/BashFAQ