From: Oleg Broytman Date: Sun, 2 Aug 2015 15:55:13 +0000 (+0300) Subject: .shellrc: reset HOME if /home is a symlink X-Git-Url: https://git.phdru.name/?p=dotfiles.git;a=commitdiff_plain;h=7db5ad342b819ef150c3caf661bdad38de3120cd .shellrc: reset HOME if /home is a symlink On BSD /home is a symlink to /usr/home. --- diff --git a/.shellrc b/.shellrc index 67f9b76..85ca29e 100644 --- a/.shellrc +++ b/.shellrc @@ -6,6 +6,18 @@ OPS1="$OPS1\\$" PS1="$OPS1 " +case "$HOME" in + /home/*) + home_link="`readlink /home`" + if [ -n "$home_link" ]; then + START_DIR="`pwd`" && + cd "$HOME" && + HOME="`pwd`" && + cd "$START_DIR" + fi + ;; +esac + case "$SHELL" in */bash) [ "`type -t ls`" = alias ] && unalias ls