I am using
echo "HELLO"
I want to specify a number shiftWt so that I move hello forward by shiftWt charcaters.
Is there a way to do this?
I am using
echo "HELLO"
I want to specify a number shiftWt so that I move hello forward by shiftWt charcaters.
Is there a way to do this?
# prepend
printf "%20s\n" "HELLO"
I have coded it like this. Suppose I want to have 3 blank characters before the string. If the string is longer than 20 characters, I would not have the 3 characters in the beginning.
set blk = "" # Create a blank string of size shiftWt.
@ x = 1
while ($x <= $shiftWt)
set blk = " $blk"
@ x += 1
end
set len = ${%strLst4}
if ($len > 0) then
if ($i > 1) echo ""
foreach str ($strLst4)
echo "${blk}${str}" # Add blank string to beginning.
end
@ i++
endif