Skip to content

Instantly share code, notes, and snippets.

@bastelfreak
Created February 5, 2014 20:22
Show Gist options
  • Select an option

  • Save bastelfreak/8832262 to your computer and use it in GitHub Desktop.

Select an option

Save bastelfreak/8832262 to your computer and use it in GitHub Desktop.
#!/bin/bash
get_html_title (){
curl --silent "${1}" | awk -vRS="</title>" '/<title>/{gsub(/.*<title>|\n+/,"");print;exit}'
}
get_html_title $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment