Last active
August 29, 2015 14:13
-
-
Save fzerorubigd/a781e6425b810cbbe336 to your computer and use it in GitHub Desktop.
zshrc_multiuser
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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