The UNIX and Linux Forums  


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




Thread: check space !!!
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 11-09-2005
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,126
You can't do stuff like:
if [ "$SPACE" < "$TEST" ]
At least not sensibly. " < $TEST" is used to redirect the input of the test command to the file called $TEST. Since test does not use an input file, this does nothing. This is one of several dozen reason why you should switch to:
if [[ whatever ]]
Not only would < do what you wanted it to, but then you no longer need the quotes around the variables.