Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 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
|
||||
6
Task/Loops-For/UNIX-Shell/loops-for-2.sh
Normal file
6
Task/Loops-For/UNIX-Shell/loops-for-2.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for i in `jot 5`; do
|
||||
for j in `jot $i`; do
|
||||
printf \*
|
||||
done
|
||||
echo
|
||||
done
|
||||
6
Task/Loops-For/UNIX-Shell/loops-for-3.sh
Normal file
6
Task/Loops-For/UNIX-Shell/loops-for-3.sh
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
for (( x=1; $x<=5; x=$x+1 )); do
|
||||
for (( y=1; y<=$x; y=$y+1 )); do
|
||||
echo -n '*'
|
||||
done
|
||||
echo ""
|
||||
done
|
||||
8
Task/Loops-For/UNIX-Shell/loops-for.sh
Normal file
8
Task/Loops-For/UNIX-Shell/loops-for.sh
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
for i in {1..5}
|
||||
do
|
||||
for ((j=1; j<=i; j++));
|
||||
do
|
||||
echo -n "*"
|
||||
done
|
||||
echo
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue