Skip to content

Instantly share code, notes, and snippets.

@ndrluis
Created June 24, 2013 14:25
Show Gist options
  • Save ndrluis/5850427 to your computer and use it in GitHub Desktop.
Save ndrluis/5850427 to your computer and use it in GitHub Desktop.
awk functions
# TRIM
function ltrim(s) { sub(/^[ \t]+/, "", s); return s }
function rtrim(s) { sub(/[ \t]+$/, "", s); return s }
function trim(s) { return rtrim(ltrim(s)); }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment