Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 06 Jan 2005 21:00:44 -0700
From:      Tom Vilot <tom@vilot.com>
To:        Eric F Crist <ecrist@secure-computing.net>
Cc:        FreeBSD-Questions Questions <freebsd-questions@freebsd.org>
Subject:   Re: my lame attempt at a shell script...
Message-ID:  <41DE096C.3060903@vilot.com>
In-Reply-To: <1F964093-6051-11D9-90DC-000D9333E43C@secure-computing.net>
References:  <06DDB71C-5DB4-11D9-B56F-000D9333E43C@secure-computing.net> <8B357427-5DB7-11D9-89A5-000D93AD26C8@tntluoma.com> <Pine.NEB.4.61.9.0501041028340.407@kenmore.kozy-kabin.nl> <7B531D49-6041-11D9-8A15-000D9333E43C@secure-computing.net> <41DDE5C5.2050402@vilot.com> <1F964093-6051-11D9-90DC-000D9333E43C@secure-computing.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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 ....



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41DE096C.3060903>