detect redhat
[zsh.git] / .zsh / zshenv.home
1 # -*- mode: sh;-*-
2 ############
3 #
4 # .zshenv
5 # Written by Joerg Jaspert <joerg@debian.org>
6 #
7 ############
8 # This assumes that $HOME/.zshenv is a symlink to
9 # $ZDOTDIR/zshenv.home (as is my default).
10 if zp=$(readlink -f ${HOME}/.zshenv 2>/dev/null); then
11 zp=${zp%/*}
12 elif zp=$(greadlink -f ${HOME}/.zshenv 2>/dev/null); then
13 # MacOS readlink isn't up to the task, user needs to
14 # install the gnu coreutils for it
15 zp=${zp%/*}
16 else
17 # If both fail, use the "traditional" way of hardcoding
18 zp="${HOME}/.zsh"
19 fi
20 ZDOTDIR=${ZDOTDIR:-$zp}
21
22 [ -r "${ZDOTDIR}/zshenv" ] && source "${ZDOTDIR}/zshenv"
23
24 # If you want to "profile" the shell initialization, enable
25 # the following lines.
26 # Don't have this enabled for normal use, its pretty distracting and
27 # also changes some initialization behaviour (re prompts)
28
29 ## Set the trace prompt to be like
30 ## YYYY-MM-DD HH:MM:SS scriptname(function):line>
31 #PS4='%D{%Y-%m-%d %H:%M:%S} %x(%N):%i> '
32 ## save file stderr to file descriptor 3 and redirect stderr (including trace
33 ## output) to a tempfile
34 #INITLOG=$(mktemp --tmpdir=/tmp zshlog.XXXXX.${USER}.$(date +%s))
35 #exec 3>&2 2>${INITLOG}
36 ## set options to turn on tracing and expansion of commands contained in the prompt
37 #setopt xtrace prompt_subst
38
39 # Store "starttime" of shell in case user wants to see how long loading took
40 _start_time=$(( $(( $(date +%s) * 1000000000 )) + $(date +%N) ))
41 # Variable is removed on end of shell load
42
43 # Don't do anything more in here, do everything inside
44 # $ZDOTDIR!