&& [[ ! $BASH_LOGIN_SHELL == true ]]; then
return
else
- source /etc/profile
- source ~/brc
+ if [[ -r /etc/profile ]]; then
+ source /etc/profile
+ fi
+ _x=$(readlink -f $BASH_SOURCE)
+ _x=${_x%/*}/brc
+ if [[ -r $_x ]]; then
+ source $_x
+ fi
fi
c -
}
-bashrcpush () {
- local startdir="$PWD"
- cd ~
- for x in "$@"; do
- ssh $x mkdir -p bin/distro-functions/src
- tar cz bin/semi-private bin/distro-functions/src | ssh $x tar xz
- done
- cd $(mktemp -d)
- command cp /a/c/repos/bash/!(.git|..|.) ~/.gitconfig .
- for x in "$@"; do
- tar cz * | ssh $x tar xz
- done
- cd "$startdir"
-}
-
bkrun() {
# use -p from interactive shell
btrbk-run -p "$@"
}
rlu() { # [OPTS] HOST PATH
- # eg rlu -opts frodo /testpath
+ # eg. rlu -opts frodo /testpath
+ # relative paths will expanded with readlink -f.
# useful for selectively sending dirs which have been synced with unison,
# where the path is the same on both hosts.
opts=("${@:1:$#-2}") # 1 to last -2
path="${@:$#}" # last
host="${@:$#-1:1}" # last -1
- if [[ $path == .* ]]; then echo error: need absolut path; return 1; fi
+ if [[ $path == .* ]]; then
+ path=$(readlink -f $path)
+ fi
# rync here uses checksum instead of time so we don't mess with
# unison relying on time as much. g is for group, same reason
# to keep up with unison.