mirror of
https://github.com/techarkit/shell-scripting-tutorial.git
synced 2025-08-03 07:34:30 +00:00
Create while loop
This commit is contained in:
15
while loop
Normal file
15
while loop
Normal file
@ -0,0 +1,15 @@
|
||||
While Loop Example, print any given number table.
|
||||
|
||||
#!/bin/bash
|
||||
## While Loop Example with 2 table
|
||||
echo -e "Please provide one value:\c"
|
||||
read -r c
|
||||
i=1
|
||||
while [ $i -le 10 ]
|
||||
do
|
||||
b=`expr $c \* $i`
|
||||
echo "$c * $i = $b"
|
||||
i=`expr $i + 1`
|
||||
done
|
||||
|
||||
See Full Explanation of this above shell script [while loop](https://www.youtube.com/Techarkit?sub_confirmation=1)
|
Reference in New Issue
Block a user