Display the Patterns in Linux Bash shell programming

Source code bash shell Programming Algorithm
for a in 1 2 3 4
do
j=1
while [ $j -le $a ]
do
echo -n "*"
j=` expr $j + 1`
done
echo " "
done

OUPUT CS1252 Operating Systems lap
[redhat35@localhost Rhel5]$ sh display.sh
*
**

***
****
GENERATING 1 2 3 SERIES
Source code bash shell Programming Algorithm
clear
for i in 1 2 3
do
for j in 1 2 3
do
for k in 1 2 3
do
echo “$i $j $k”
done
done
done
OUPUT CS1252 Operating Systems lap
[redhat35@localhost Rhel5]$ sh series.sh
111
112
113
121
122
123
131
132
133
211
---
---
----
323
331
332
333

Related post