Mercurial > ec-dotfiles
diff rc/tcsh @ 248:fbb03c862b63
Awesome merge.
author | Edho Arief <edho@myconan.net> |
---|---|
date | Tue, 08 Nov 2011 11:59:49 +0700 |
parents | f74212d79fcb |
children | 3a0bd37d37c0 |
line wrap: on
line diff
--- a/rc/tcsh Tue Nov 08 11:56:49 2011 +0700 +++ b/rc/tcsh Tue Nov 08 11:59:49 2011 +0700 @@ -1,5 +1,23 @@ #!/usr/bin/env tcsh -[ -e "${HOME}/.ecos_tcsh.before" ] && source "${HOME}/.ecos_tcsh.before" + +# Ensures it's tcsh +if ( ! $?tcsh ) then + exit +endif + +# Ensures this script is running on terminal. Otherwise exit immediately. +if ( ! $?prompt ) then + exit +endif + +# Ensures we're not loading this script again. +if ( ! $?ecos_tcsh_loaded ) then + set ecos_tcsh_loaded="yes" +else + exit +endif + +test -f "${HOME}/.ecos_tcsh.before" && source "${HOME}/.ecos_tcsh.before" umask 22 limit coredumpsize 0 @@ -78,7 +96,7 @@ case OpenBSD: set path=(${path} /usr/local/{bin,sbin}) setenv LSCOLORS ExGxFxdxCxegedabagExEx - [ "${iscolor}" -eq 1 ] && setenv TERM xterm-256color + test "${iscolor}" -eq 1 && setenv TERM xterm-256color ( which colorls ) > /dev/null && alias ls colorls -FG breaksw case DragonFly: @@ -88,7 +106,7 @@ breaksw case SunOS: set path=(${path} /usr/{gnu,csw,xpg4}/{bin,sbin}) - [ -x /usr/gnu/bin/ls ] && alias ls /usr/gnu/bin/ls ${gnuls_opts} + test -x /usr/gnu/bin/ls && alias ls /usr/gnu/bin/ls ${gnuls_opts} breaksw case Linux: alias ls ls ${gnuls_opts} @@ -99,6 +117,6 @@ ( which vim ) > /dev/null && alias vi vim && setenv EDITOR vim -[ -e "${HOME}/.ecos_tcsh.after" ] && source "${HOME}/.ecos_tcsh.after" +test -f "${HOME}/.ecos_tcsh.after" && source "${HOME}/.ecos_tcsh.after" -[ -x "/usr/games/fortune" ] && "/usr/games/fortune" +test -x "/usr/games/fortune" && "/usr/games/fortune"