Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bash if file exists



 On Fri, Apr 04, 2008 at 09:33:58PM -0400, David Rosenstrauch wrote: 
> 
> What about the curly braces though?  Never seen that before either. 

That's just habit, mostly.  See "Brace Expansion" in bash(1) for all 
the fun things you can do inside curly braces.  In this case it wasn't 
necessary, but I do it for consistency.  It's useful when you need to 
embed a variable in a string, such as: 

for x in 1 2 3 ; do echo "${x}blah" ; done 

Without the braces you get three blank lines.  With the braces you get 
the expected output. 

-- 
Matt Brodeur                                                     RHCA 
[hidden email]                         http://www.nexttime.com
PGP ID: 2CFE18A3 / 9EBA 7F1E 42D1 7A43 5884  560C 73CF D615 2CFE 18A3 
All generalizations are false, including this one. 
_______________________________________________ 
Discuss mailing list 
[hidden email] 
http://lists.blu.org/mailman/listinfo/discuss
 


BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org