[Pm-utils] coding style $var vs. ${var}

Victor Lowther victor.lowther at gmail.com
Wed Apr 23 17:52:44 PDT 2008


On Wed, 2008-04-23 at 00:26 +0200, Michael Biebl wrote:
> 2008/4/22, Richard Hughes <hughsient at gmail.com>:
> > On Tue, 2008-04-22 at 23:18 +0200, Michael Biebl wrote:
> >  > ${var}
> >
> >  +1
> 
> The relevant documentation is
> http://www.faqs.org/docs/bashman/bashref_29.html#SEC29
> 
> FWIW I prefer the shorter $var (less typing), and only use braces when
> absolutely necessary (string manipulation, $var is followed by a
> character that is not to be interpreted as part of the variable name).

This is what I prefer from a stylistic standpoint, except I lean towards
using braces whenever there is any ambiguity about what you mean.

> Cheers,
> Michael
> 
-- 
Victor Lowther
Ubuntu Certified Professional



More information about the Pm-utils mailing list