Skip to content

Instantly share code, notes, and snippets.

@coderofsalvation
Created March 1, 2014 01:12
Show Gist options
  • Save coderofsalvation/9283269 to your computer and use it in GitHub Desktop.
Save coderofsalvation/9283269 to your computer and use it in GitHub Desktop.
strip html/xml tags from input string
# strip html/xml tags from input string
# usage: echo "<b>foo</b>" | striphtml <-- returns 'foo'
striphtml(){
echo "$1" | sed 's|<[^>]*>||g'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment