Add bash config
This commit is contained in:
parent
1277c6d335
commit
f98b7d00f7
4 changed files with 125 additions and 0 deletions
15
.functions
Normal file
15
.functions
Normal file
|
@ -0,0 +1,15 @@
|
|||
# .bashrc
|
||||
|
||||
iploc () { curl -s http://ip-api.com/json/"$1"|tr , '\n'|sed 's/[\"{}]//g'; }
|
||||
|
||||
function parse_git_branch () {
|
||||
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
|
||||
}
|
||||
|
||||
function parse_fossil_branch () {
|
||||
fossil branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
|
||||
}
|
||||
|
||||
yell() { echo "$0: $*" >&2; }
|
||||
die() { yell "$*"; exit 111; }
|
||||
try() { "$@" || die "cannot $*"; }
|
Loading…
Add table
Add a link
Reference in a new issue