Problem with space padding
I "thought" this was how to pad spaces in front of a line:
spaces=" "
pdl=12
pad=`echo "$spaces" | cut -c $pdl`
echo "B${pad}E"
but I get:
B E
I've tried with a constant instead of "$pdl" and get the same thing.
I "THINK" I have used this before but I am not able to get the proper pad length created. Use of printf had similar problems. Does anyone see my mistake. I would like to find a correction rather than an alternate padding solution since I feel certain I've used this before.
Thanks
|