Mercurial > hg > zsh-env
comparison zshrc @ 10:6c4ab833e66d
emulate tcsh's subprocess behaviour: automatically nohup the jobs, do not warn when exiting the shell
| author | Dirk Olmes <dirk@xanthippe.ping.de> |
|---|---|
| date | Fri, 02 Dec 2011 15:27:54 +0100 |
| parents | 7364a3399187 |
| children | 13e0030ddaad |
comparison
equal
deleted
inserted
replaced
| 9:7364a3399187 | 10:6c4ab833e66d |
|---|---|
| 19 ff() { find $2 -print0 | xargs -0 grep $1 } | 19 ff() { find $2 -print0 | xargs -0 grep $1 } |
| 20 hgrep() { history | grep $* } | 20 hgrep() { history | grep $* } |
| 21 mcd() { mkdir $1; cd $1 } | 21 mcd() { mkdir $1; cd $1 } |
| 22 psg() { ps auxww | grep -v grep | grep -i "$@" } | 22 psg() { ps auxww | grep -v grep | grep -i "$@" } |
| 23 | 23 |
| 24 # no history handling for now ... or find a better way to save history per shell not across all shells | |
| 25 export HISTFILE= | |
| 26 | |
| 27 # emulate tcsh's behaviour for forked processes: do not warn, do not kill when shell is closed | |
| 28 setopt nohup | |
| 29 setopt no_check_jobs | |
| 30 | |
| 31 # $HOST can either be just the host name or the FQDN. Standardize on the raw host name | |
| 32 export HOST=`echo $HOST | awk -F '.' '{ print $1 }'` | |
| 33 | |
| 24 # utility function that is used by various other modules | 34 # utility function that is used by various other modules |
| 25 removeFromPath() { | 35 removeFromPath() { |
| 26 search_term="$1" | 36 search_term="$1" |
| 27 split_path=(${(s/:/)PATH}) | 37 split_path=(${(s/:/)PATH}) |
| 28 clean_path="" | 38 clean_path="" |
| 39 fi | 49 fi |
| 40 done | 50 done |
| 41 echo "${clean_path}" | 51 echo "${clean_path}" |
| 42 } | 52 } |
| 43 | 53 |
| 44 # no history handling for now ... or find a better way to save history per shell not across all shells | |
| 45 export HISTFILE= | |
| 46 | |
| 47 # $HOST can either be just the host name or the FQDN. Standardize on the raw host name | |
| 48 export HOST=`echo $HOST | awk -F '.' '{ print $1 }'` | |
| 49 | |
| 50 # include a zshrc per OS type | 54 # include a zshrc per OS type |
| 51 local os_zshrc=$HOME/.zsh-env/zshrc-$OSTYPE | 55 local os_zshrc=$HOME/.zsh-env/zshrc-$OSTYPE |
| 52 if [ -f ${os_zshrc} ]; then | 56 if [ -f ${os_zshrc} ]; then |
| 53 . ${os_zshrc} | 57 . ${os_zshrc} |
| 54 fi | 58 fi |
