langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
15
Task/Loops-For/UNIX-Shell/loops-for-1.sh
Normal file
15
Task/Loops-For/UNIX-Shell/loops-for-1.sh
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
# Using a while control construct to emulate a for loop
|
||||
|
||||
l="1" # Set the counters to one
|
||||
while [ "$l" -le 5 ] # Loop while the counter is less than five
|
||||
do
|
||||
m="1"
|
||||
while [ "$m" -le "$l" ] # Loop while the counter is less than five
|
||||
do
|
||||
printf "*"
|
||||
m=`expr "$m" + 1` # Increment the inner counter
|
||||
done
|
||||
echo
|
||||
l=`expr "$l" + 1` # Increment the outer counter
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue