How to remove extra spaces in variable HEAD?
HEAD
HEAD=\" how to remove extra spaces \"
Result:>
echo variable without quotes does what you want:
HEAD=" how to remove extra spaces " echo $HEAD # or assign to new variable NEW_HEAD=$(echo $HEAD) echo $NEW_HEAD
output: how to remove extra spaces
how to remove extra spaces