In terminal let's run..
a=' aa a '
b=`echo $a | sed -e 's/^ *//g' -e 's/ *$//g'`
i believe it removes empty spaces from beginning and ending of the script.
but preserves the empty space inbetween
aa a
but when i run this in a bash script.. it returns with
aaa
the empty space in-between string is removed too.
perhaps i need to escape something ?
Try this :
it will output :