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 -->
  #5 (permalink)  
Old 08-29-2007
robotronic's Avatar
robotronic robotronic is offline Forum Advisor  
Can I play with madness?
  
 

Join Date: Apr 2002
Location: Italy
Posts: 370
It's much more simpler if you use numbers as starting points:


Code:
START_POINT="$1"

if [ ! "$START_POINT" ]; then START_POINT=0; fi

if [ "$START_POINT" -le 10 ]; then echo "Running 10!"; fi
if [ "$START_POINT" -le 20 ]; then echo "Running 20!"; fi
if [ "$START_POINT" -le 30 ]; then echo "Running 30!"; fi

Then you specifiy a parameter and, if the number is lesser than the execution step, the code will be executed.