Skip to content

Instantly share code, notes, and snippets.

@pearkes
Created June 30, 2013 17:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pearkes/5896167 to your computer and use it in GitHub Desktop.
Save pearkes/5896167 to your computer and use it in GitHub Desktop.
If you run `host` with https://google.com, this strips the https://
#!/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
@dentarg
Copy link

dentarg commented Sep 22, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment