The UNIX and Linux Forums  
Hello and Welcome from to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-27-2005
forevercalz forevercalz is offline
Registered User
  
 

Join Date: Sep 2005
Posts: 74
how to convert things from csh to sh

i have this method in csh that check for file exist.


#check that file exists
if ( ! -e $6$5 ) then
echo $6$5 Not Found
exit 8
endif

however i wanted in to be in just sh. so i change the code to:
if [ ! -e $6$5 ]; then
echo $6$5 Not Found
exit 8
fi

I get error showing test arguments needed or something like this..is there any problem with my coding? Btw the parameters are passed in...$5 is a text file and $6 is a path name.