The syntax is as follows to cycle through a loop forever using while loop:
while [ 1 ]OR use the following syntax:
do
command1
command2
done
while :; do echo 'Hit CTRL+C'; sleep 1; done
For loop example
To cycle through a loop forever using for loop:
for (( ; ; ))
do
echo "Pres CTRL+C to stop..."
sleep 1
done
No comments:
Post a Comment