The UNIX and Linux Forums  

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 -->
  #2 (permalink)  
Old 10-28-2005
Unbeliever Unbeliever is offline
Registered User
  
 

Join Date: Jul 2005
Location: England
Posts: 183
Put quote around the variable argument in the if staement. eg

if [ ! -e "$6$5" ]

The reason you get an error in your own code when $5 and $6 are both empty is that the '-e' test requires an argument. By putting quotes round it you force an argument of a null string (rather than no argument at all) when $5 and $6 are both empty.

Last edited by Unbeliever; 10-28-2005 at 11:06 AM..