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 | Blog | 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



 Matt Brodeur wrote: 
> 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: 


Tnx much for pointing me to the right "M" in RTFM!  :-)  In all 
seriousness, much appreciated - I'm always interested to learn something 
that'll make me code better. 


> 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. 

Boy, dem bash some wacky stuff, sometimes!!!  :-) 

Tnx again, 

DR 

-- 
This message has been scanned for viruses and 
dangerous content by MailScanner, and is 
believed to be clean. 

_______________________________________________ 
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