my lame attempt at a shell script...

Tom Vilot tom at vilot.com
Fri Jan 7 08:36:37 PST 2005


Eric F Crist wrote:

> What is the point of the { } around some variables? 


It's not strictly necessary, except in some cases. i.e:

m=34

echo $m


You don't need it there.

But you would want it here:


f=/var/filename

fname=${f//name/name2}


It's when you need to differentiate the variable name from operations 
around it ... for want of a better explanation ....





More information about the freebsd-questions mailing list