X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fzsh%2Fzshenv;h=7397397c3f7f854f4ab5588dbab0f53d87636caf;hb=9c35415b4f1f3bde1b09b40ae765cf377d204b93;hp=954ca389b679979beaaaa0bfd45ca7383d9660be;hpb=737b243d3fa565b2c1b57ba694c8cf3487f95b7f;p=grml-etc-core.git diff --git a/etc/zsh/zshenv b/etc/zsh/zshenv index 954ca38..7397397 100644 --- a/etc/zsh/zshenv +++ b/etc/zsh/zshenv @@ -26,7 +26,11 @@ [[ -r /etc/environment ]] && source /etc/environment # set environment variables (important for autologin on tty) -export HOSTNAME=${HOSTNAME:-$(hostname)} +if [ -n "${HOSTNAME}" ] ; then + export HOSTNAME="${HOSTNAME}" +else + export HOSTNAME="$(uname -n)" +fi # make sure /usr/bin/id is available if [[ -x /usr/bin/id ]] ; then @@ -51,8 +55,8 @@ fi # support extra scripts/software in special directory outside of squashfs environment in live mode if [[ -f /etc/grml_cd ]] ; then - [[ -r /lib/live/mount/medium/scripts ]] && ADDONS='/lib/live/mount/medium/scripts' - [[ -r /etc/grml/my_path ]] && ADDONS="$(cat /etc/grml/my_path)" + [[ -r /run/live/medium/scripts ]] && ADDONS='/run/live/medium/scripts' + [[ -r /etc/grml/my_path ]] && ADDONS="$(cat /etc/grml/my_path)" fi # Solaris @@ -90,17 +94,21 @@ if (( EUID != 0 )); then ) else path=( + $HOME/bin + /usr/local/sbin + /usr/local/bin /sbin /bin /usr/sbin /usr/bin - /usr/local/sbin - /usr/local/bin "${ADDONS}" "${path[@]}" ) fi +# remove empty components to avoid '::' ending up + resulting in './' being in $PATH +path=( "${path[@]:#}" ) + typeset -U path # less (:=pager) options: