-
-
Save pearkes/5896167 to your computer and use it in GitHub Desktop.
If you run `host` with https://google.com, this strips the https://
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
#!/bin/sh | |
# cp host /usr/local/bin/ | |
# I only use host for checking records, and 9 times out of 10 | |
# I copy paste the url from my browser. Chrome adds http[s]:// | |
if [ -n "$1" ] | |
then | |
# 1 parameter, let's do this thing | |
/usr/bin/host ${1#*//} | |
else | |
# Carry on | |
/usr/bin/host "$@" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Actually, Chrome also adds a trailing
/
. I made an attempt to remove it, but I only got i working with zsh. Take a look at my fork if you want.