Apr 29, 2002 #1 gfunk123 IS-IT--Management May 22, 2001 143 GB i need to be able to write a ksh script like this if fileX and fileY and fileZ exist then blah blah blah. Ive tried if [ -f fileX -a -f fileY -a -f fileZ ] then .....but this does not seem to work does anybody know the syntax for this cheers
i need to be able to write a ksh script like this if fileX and fileY and fileZ exist then blah blah blah. Ive tried if [ -f fileX -a -f fileY -a -f fileZ ] then .....but this does not seem to work does anybody know the syntax for this cheers
Apr 29, 2002 #2 RobJordan MIS Apr 3, 2001 296 US I belive you want to use && for AND or || for OR. I think this may work, but you'll need to test it. if [ -f fileX ] && [ -a -f fileY ] && [ -a -f fileZ ] then Robert Robert G. Jordan Unix Sys Admin Sleepy Hollow, Illinois U.S.A. http://www.InYourMind.comFREE Unix Scripts Upvote 0 Downvote
I belive you want to use && for AND or || for OR. I think this may work, but you'll need to test it. if [ -f fileX ] && [ -a -f fileY ] && [ -a -f fileZ ] then Robert Robert G. Jordan Unix Sys Admin Sleepy Hollow, Illinois U.S.A. http://www.InYourMind.comFREE Unix Scripts