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]

(no subject)



 On Thu, Apr 03, 2008 at 06:55:36PM -0400, Derek Martin wrote: 
> Which can be further simplified to: 
> 
> if ls *.zip >/dev/null 2>&1; then 

That's probably more elegant on some level than my $?.  Derek's test of the 
ls exit status embedded in the if statement jogged my memory for another 
method: 

ls *.zip > /dev/null 2>&1 && echo 'zips!' || echo 'zippo!' 

There ends up being a tradeoff between brevity and legibility at some 
point, but I don't think we've hit it yet.  Anyone got a shorter one? 

:-) 

-b 

-- 
doubt is an uncomfortable position, but certainty is a ridiculous one. 
                                                            <voltaire> 

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