On 6/6/07, Roland Mainz <[EMAIL PROTECTED]> wrote:
Mike Gerdts wrote: > On 6/6/07, Michael Shapiro <[EMAIL PROTECTED]> wrote: [snip] > One nit. In the Quoting section it says: > > Use whatever quotes are appropriate for your situation, but please > do not unnecessarily quote everything (also see 7 above). > > The numbers for the sections are missing but I think it refers to the > reference to ${bar} vs. ${bar}. Rather unfortunately, in that section > there is gratuitous quoting. > > [ $install = yes ] && root="/a/" || root="/" > > The stuff to the right of each root= doesn't need quotes.If the variable "root" contains a filename as value then quotes should be used. IMHO _ALWAYS_ with _ZERO_ exceptions.
Quote $root, yes. Quote a trivial value being assigned to root, no.
Otherwise you'll run into "funny" problems with things like $ rm -rf $root/foo/bar/$snap # when either "snap" or "root" are not set. IMO the
Quoting and braces don't help the above situation at all when the variables aren't set. Quoting will help if one or both has white space. Braces serve no purpose - not even adding clarity. To the contrary, sprinkling extra braces (as a rule) like this can reduce readability because lines are more likely to wrap. -- Mike Gerdts http://mgerdts.blogspot.com/ _______________________________________________ opensolaris-code mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/opensolaris-code
