#!/bin/bash ############################################################################ # http://linuxMeister.net/Scripts/while-loop.sh.html # SAMPLE: WHILE LOOP - counter john meister jun 2013 ############################################################################ # cat /dev/null > count.txt # clear output file X=1 # declare starting value X=1 echo "********************** counting to 10 *******************************" while [ $X -le 10 ] # while the count is less than 10 do echo ">>--> $X" | tee -a count.txt # display count and add to file X=$(( $X + 1 )) # increment variable by one sleep 1 # sleep for 1 second done echo "********************** done! ***************************************" ############################################################################ |
The Art of Linux System Administration published by O'Reilly Media Study Guide for the LPIC-2 Certification Exams |
Wagoneers FULL SIZE JEEPS JeepMeister "Jeep is America's -Enzo Ferrari MeisterTech Diesels + |
One Page Overview of Linux Commands click for an image of the 5 essential Linux commands An Intro to Linux |
at Midway Auto on SR9 in Snohomish, or at Northland Diesel in Bellingham, WA |