I wrote a couple of scripts some time back and remember using following code to trim the extra spaces
Code:
echo "single = word" | awk -F'=' '{gsub(/^[[:blank:]]+/,"",$2) gsub(/[[:blank:]]+$/,"",$2); print $2}'
I think it used to work fine but it's not working now.
Any suggestions, why [[:blank:]] thing is not working but [ \t] is ?
PS: In case it matters, I wrote this when I used to work on Fedora. Have been using Ubuntu for the past one year now