Shell Script Loop
while
#!/bin/sh
a=0
while [ $a -lt 10 ]
do
echo $a
a=`expr $a + 1`
done
for
#!/bin/sh
for var in 0 1 2 3 4 5 6 7 8 9
do
echo $var
done
for FILE in $HOME/.bash*
do
echo $FILE
done
for i in {1..25}
do
echo "flnuehy nhyvn" | caesar $i
done
until loop
#!/bin/sh
a=0
until [ ! $a -lt 10 ]
do
echo $a
a=`expr $a + 1`
done
select loop
#!/bin/ksh
select DRINK in tea cofee water juice appe all none
do
case $DRINK in
tea|cofee|water|all)
echo "Go to canteen"
;;
juice|appe)
echo "Available at home"
;;
none)
break
;;
*) echo "ERROR: Invalid selection"
;;
esac
done