Skip to content

Instantly share code, notes, and snippets.

@fzerorubigd
Last active August 29, 2015 14:13
Show Gist options
  • Save fzerorubigd/a781e6425b810cbbe336 to your computer and use it in GitHub Desktop.
Save fzerorubigd/a781e6425b810cbbe336 to your computer and use it in GitHub Desktop.
zshrc_multiuser
#!/bin/env zsh
# to setup :
# mkdir $ROOT/yourname
# $EDITOR $ROOT/yourname/zshrc
ROOT=~/.profiles
if [ -z $PROFILE_DIR ];then
pushd $ROOT >/dev/null
FILES=($ROOT/*/)
FILES+=("Exit")
select f in ${FILES[*]}
do
if [[ "$f" == 'Exit' ]];then
return
fi
if [ -f "$f/zshrc" ];then
PROFILE_DIR="$f"
break
fi
done
export PROFILE_DIR
popd >/dev/null
fi
PROFILE_HISTORY="${PROFILE_DIR}zsh_history"
export HISTFILE=$PROFILE_HISTORY
source $PROFILE_DIR/zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment