12 lines
317 B
Text
12 lines
317 B
Text
# .bashrc
|
|
|
|
iploc () { curl -s http://ip-api.com/json/"$1"|tr , '\n'|sed 's/[\"{}]//g'; }
|
|
|
|
function parse_branch {
|
|
scmexe=${1:-git}
|
|
$scmexe branch 2> /dev/null | awk '/^*/{$1="";sub(/^ /, "");print "("$0")"}'
|
|
}
|
|
|
|
yell() { echo "$0: $*" >&2; }
|
|
die() { yell "$*"; exit 111; }
|
|
try() { "$@" || die "cannot $*"; }
|