Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Better ping cuz I hate when I need to select part of a URL to ping. And it gets worse when it comes to Chrome, which copies the http:// stuff :P Put this on you bash/zsh rc file or whatever you want...
#!/bin/bash
function ping() {
lph=`echo $1 | sed 's#https*://\([^/]*\)/.*#\1#'`
/sbin/ping $lph
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment