Quote:
Originally Posted by mrityunjay22
code is as
#!/bin/sh
i=1;
while [ $i -le 5]
do
welcome $i times;
i='expr $i+1';
done
exit 0;
|
The while test expression should have proper spacing as well as the line that increments i. Don't need the terminating semicolons after every command. Is welcome as in "welcome $i times" a functon in your script and it would be nice to printout the value of i while executing the loop...
Code:
#!/bin/sh
i=1
while [ $i -le 5 ]
do
welcome $i times;
echo "value of i is...$i"
i='expr $i + 1'
done
exit 0