Operating System Shell Scripting/Programs on Linux
Linux Shell Scripting programs
Sunday, 17 June 2012
Write a shell script to accept a number and a word as command line arguments and print the word the given number of times on each line
i=1
f=""
temp=$1" "
while [ $i -le $3 ]
do
f=$f$temp
i=`expr $i + 1`
done
i=1
while [ $i -le $2 ]
do
echo $f
i=`expr $i + 1`
done
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment