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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 12-27-2003
props props is offline
Registered User
 

Join Date: Oct 2003
Location: uk
Posts: 15
if then else structure

echo name the file that you want to read
read answer

if [ $# = 0 ]
then
echo you must enter a file name

fi
cat $answer


im trying to catch the error if user forget to enter the name of the file

anyone can help me ?
thanks
Forum Sponsor