Last active
March 11, 2022 03:01
-
-
Save gwen001/1b76009d72951966e1058995cda3a7ae to your computer and use it in GitHub Desktop.
onliner to resolve the host of a given url
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
host `echo https://pass:[email protected]: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