Remove Leading and Trailing Whitespace using gsub in AWK

# echo "  this  test   "|awk '{gsub(/^[[:space:]]+|[[:space:]]+$/,"",$0); print}'
this  test
This entry was posted in Command Line FU and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *