Skip to content

Instantly share code, notes, and snippets.

@gwen001
Last active March 11, 2022 03:01
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save gwen001/1b76009d72951966e1058995cda3a7ae to your computer and use it in GitHub Desktop.
Save gwen001/1b76009d72951966e1058995cda3a7ae to your computer and use it in GitHub Desktop.
onliner to resolve the host of a given url
host `echo https://pass:user@abracadabra-mms.starbucks.com:2996/utils/|sed "s/.*:\/\///"|cut -d '/' -f 1|cut -d '@' -f 2|cut -d':' -f 1`
function ohost {
host `echo $1|sed "s/.*:\/\///"|cut -d '/' -f 1|cut -d '@' -f 2|cut -d':' -f 1`
}
function ohosts {
while read u; do host `echo $u|sed "s/.*:\/\///"|cut -d '/' -f 1|cut -d '@' -f 2|cut -d':' -f 1`; done < $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment