Social Icons

Wednesday, 1 May 2013

Loop Patterns Using Shell Commands


#!/bin/sh
c=5;
for((i=1;i<=5;i++))
do
for((k=1;k<=c;k++))
do
  echo -n  " "
done
for((j=1;j<=i;j++))
do
echo -n "*"
echo -n " "
done
c=$(($c-1))
echo -e " "
done


exit 0

Output :

No comments:

Post a Comment

 

Sample Text

Sample text

 
Just Programming Cse DriveReputation Management