While Loop

on July 28 | in SCRIPTING | by | with No Comments

 

Below script will do five iterations.

#!/bin/bash
i=1
while [ $i -le 5 ]
do
echo “$i . Welcome to linuxmylife.com “
(( i++ ))
done

Below script will do infinite iterations.

#!/bin/bash
i=1
while true
do
echo “$i . Welcome to linuxmylife.com “
(( i++ ))
done

1960 Total Views 1 Views Today
Pin It

related posts

Comments are closed.

« »