The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
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 05-15-2006
anormal anormal is offline
Registered User
  
 

Join Date: May 2006
Posts: 2
File existence problem

I have a problem with file existence in shell. that is the code..

#!/bin/sh
if [-f example.txt]
then
echo "File Exist!!"
else
echo "Error"
fi

but it gives an error in 2nd line. Did i write example.txt wrong? Is there any (`) or (") missing? or something like that?