The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 -->
  #3 (permalink)  
Old 10-04-2006
Glenn Arndt's Avatar
Glenn Arndt Glenn Arndt is offline Forum Advisor  
Anomalous Lurker
  
 

Join Date: Feb 2006
Location: Indianapolis, IN
Posts: 255
Quote:
Originally Posted by siog
Code:
else
do nothing /*not sure how to say do thing.  should it be sleep? */

fi
You don't need an "else" statement if you don't want anything done. That is, just do
Code:
if [ $foo = $bar ]; then
  blorp
fi
If you really want to preserve your "else" but still do nothing, you can do
Code:
if [ $foo = $bar ]; then
  blorp
else
  :
fi
In your case, "sleep" wouldn't make sense since you don't have a loop; all it would do is sleep for a certain time and then quit. Usually you would sleep in a loop to wait before looping again.