The shell uses a command called test to evaluate conditional expressions. Full details of this command can be found in the test manual page. For example:
   if test ! -f $FILE
   then
     if test "$WARN" = "yes"
     then
       echo "$FILE does not exist"
     fi
   fi
First, we test to see if the filename specified by the variable $FILE exists and is a regular file. If it does not then we test to see if the variable $WARN is assigned the value yes, and if it is a message that the filename does not exist is displayed.
![[Home]](../Images/weetop.gif) 
![[Search]](../Images/weesearch.gif) 
![[Index]](../Images/weeindex.gif) This site maintained by
staff@stacken.kth.se
 This site maintained by
staff@stacken.kth.se