Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #!/bin/env zsh
  2.  
  3. ROOT=~/.profiles
  4.  
  5.  
  6. if [ -z $PROFILE_DIR ] || [ -z PROFILE_HISTORY ];then
  7. cd $ROOT
  8. FILES=($ROOT/*/)
  9. FILES+=("Exit")
  10.  
  11. select f in ${FILES[*]}
  12. do
  13. if [[ "$f" == 'Exit' ]];then
  14. return
  15. fi
  16.  
  17. if [ -f "$f/zshrc" ];then
  18. PROFILE_DIR="$f"
  19. PROFILE_HISTORY="${PROFILE_DIR}zsh_history"
  20. break
  21. fi
  22. done
  23.  
  24. export PROFILE_DIR
  25. export PROFILE_HISTORY
  26. fi
  27. export HISTFILE=$PROFILE_HISTORY
  28. source $PROFILE_DIR/zshrc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement