|
Substring not working if more than 1 space
I have a string which is something like this..
abcd efghijkl
when I use this using substring() function 2 spaces are bein considered as one starngely.
Is there any thing I am doing wroing
the input file maintest has the string specified and the code is below
while read lines
do
echo $lines | awk '{print substr($0,4,3)}'
done < maintest
the output is
d e
where as it should be 'd ' d followed by 2 blank spaces.
Please suggest
thanks
|