I want to display the "" character the entire line. Instead of manually giving "" multiple times in echo/print command, i want some short cut.
i remember i have came across a straight forward method to display particular character (for example "*" ) for n number of times in unix. but now i forgot the exact source of information.
A basic shell loop to generate exactly ${MAX} asterisks in a shell variable called ${STRING}.
#!/bin/ksh
COUNTER=0
MAX=10
STRING=""
while true
do
COUNTER=`expr ${COUNTER} + 1`
STRING="${STRING}*"
if [ ${COUNTER} -ge ${MAX} ]
then
break
fi
done
echo "${STRING}"
**********