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



 On Fri, Apr 04, 2008 at 08:51:58PM -0400, Mark Richards wrote: 
> David Rosenstrauch wrote: 
> >Matt Brodeur wrote: 
> >>Just because you don't have *enough* different answers yet: 
> >> 
> >>   set -- *.zip 
> >>   if [ -f "${1}" ] ; then 
> > 
> >Por favor - could you explain this one? 
> 
> Set the parameter list to all files meeting the specification. 
> Test to see if ${1} is a valid file and then 
> do something with it. 
> 
> ${1} could be iterated through so you can get each file. 
> 
> Pretty good for chicken scratch. 


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