-
-
Save chapeupreto/ed38476764a16b1096433a90de1c8aab to your computer and use it in GitHub Desktop.
gethost
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
# this should be included in .bashrc or /etc/profile | |
# this function extracts the hostname of a url | |
function h() | |
{ | |
[[ -z $1 ]] && echo "url deve ser fornecida" && return 1 | |
echo "$1" | sed -E 's#(ftp|https?)://## ; s#:[0-9]*##g ; s#/.*##' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment