shell quoting (was: Improving the performance of system boot by eliding unused rc.d scripts and caching the result)
Edgar Fuß <[email protected]>
| Newsgroups | gmane.os.netbsd.devel.userlevel |
|---|---|
| Message-ID | <[email protected]> |
As always, it gets interesing as soon as KRE comments on shell.
> like "for f in ${allf}" where the ${allf} value needs to be field split
> - that's not really safe, but the alternative is messy.
Why is that unsafe? What else could one do?
> Though people still write quotes around simple words like in things like
> [ "${ans}" = "yes" ]
> The quotes in "${ans}" are needed, those around yes are silly.
Well, it looks more symmetric to the eye and even in
foo="foo bar"
I find the quotes useful. At least for someone like me skipping between
programming languages in one project (I always need to look up which one of
sh/bmake/perl has elif/elsif/elseif).