Add solaris examples to /etc/zsh/zshenv
[grml-etc-core.git] / etc / zsh / zshenv
1 # Filename:      zshenv
2 # Purpose:       system-wide .zshenv file for zsh(1)
3 # Authors:       grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
4 # Bug-Reports:   see http://grml.org/bugs/
5 # License:       This file is licensed under the GPL v2.
6 # Latest change: Sam Mär 17 12:51:25 CET 2007 [mika]
7 ################################################################################
8 # This file is sourced on all invocations of the shell.
9 # It is the 1st file zsh reads; it's read for every shell,
10 # even if started with -f (setopt NO_RCS), all other
11 # initialization files are skipped.
12 #
13 # This file should contain commands to set the command
14 # search path, plus other important environment variables.
15 # This file should not contain commands that produce
16 # output or assume the shell is attached to a tty.
17 #
18 # Notice: .zshenv is the same, execpt that it's not read
19 # if zsh is started with -f
20 #
21 # Global Order: zshenv, zprofile, zshrc, zlogin
22 ################################################################################
23
24 # language settings (read in /etc/environment before /etc/default/locale as
25 # the latter one is the default on Debian nowadays)
26   [ -r /etc/environment    ] && source /etc/environment
27   if [ -n "$LANG" ]  ; then
28      export LANG
29   else
30      [ -r /etc/default/locale ] && source /etc/default/locale
31   fi
32   [ -n "$LANG" ]          && export LANG || export LANG="en_US.iso885915"
33   [ -n "$LC_ALL" ]        && export LC_ALL
34   [ -n "$LC_MESSAGES" ]   && export LC_MESSAGES
35
36   [ -r /etc/sysconfig/keyboard ] && source /etc/sysconfig/keyboard
37   [ -r /etc/timezone ] && TZ=$(cat /etc/timezone)
38
39 # set environment variables (important for autologin on tty)
40   [ -z "$HOSTNAME" ]      && export HOSTNAME=`hostname`
41   [ -z "$USER" ]          && export USER=`id -un`
42   [[ $LOGNAME == LOGIN ]] && LOGNAME=$(id -un)
43
44 # workaround for live-cd mode as $HOME is not set via rungetty
45   if [ -f /etc/grml_cd ] ; then
46     if (( EUID == 0 )); then
47        export HOME=/root
48     else
49        export HOME=/home/$USER
50     fi
51   fi
52
53 # set $PATH
54 # gentoo users have to source /etc/profile.env
55   if [ -r /etc/gentoo-release ] ; then
56      [ -r /etc/profile.env ] && source /etc/profile.env
57        if (( EUID != 0 )); then
58           PATH="$HOME/bin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/games:/usr/NX/bin:$PATH"
59        else
60           PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin:/usr/NX/bin:$PATH"
61        fi
62   else
63     # support extra software in special directory outside of squashfs environment in live-cd mode
64     if [ -f /etc/grml_cd ] ; then
65        [ -d /cdrom/addons/ ] && ADDONS=':/cdrom/addons/'
66     fi
67     if (( EUID != 0 )); then
68       PATH="$HOME/bin:/bin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/games:/usr/NX/bin$ADDONS"
69     else
70       PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/local/bin:/usr/NX/bin$ADDONS"
71     fi
72   fi
73
74   # Solaris 
75   # case $(uname 2>/dev/null) in
76   #   SunOS)
77   #      PATH="/usr/bin:/usr/sbin:/usr/ccs/bin:/usr/sfw/bin:/opt/sfw/bin:/opt/bin:/usr/local/bin:/usr/openwin/bin:/usr/dt/bin:/usr/ucb:/usr/proc/bin:~/bin"
78   #      # LD_LIBRARY_PATH="/opt/csw/lib:/opt/sfw/lib:/usr/lib:/usr/local/lib:/usr/ccs/lib:/usr/openwin/lib:/usr/ucb/lib"
79   #      # MANPATH="$MANPATH:/opt/csw/man:/usr/man:/usr/share/man:/usr/local/man:/opt/sfw/man"
80   #esac
81
82 # less (:=pager) options:
83 #  export LESS=C
84   export LESSOPEN="|lesspipe.sh %s"
85   export READNULLCMD=${PAGER:-/usr/bin/pager}
86
87 # allow zeroconf for distcc
88   export DISTCC_HOSTS="+zeroconf"
89
90 # MAKEDEV should be usable on udev as well by default:
91   export WRITE_ON_UDEV=yes
92
93 ## END OF FILE #################################################################