From 72896f1d1d0ae633d360aede3956d42036fd600d Mon Sep 17 00:00:00 2001 From: hugues Date: Wed, 16 May 2007 10:17:44 +0000 Subject: =?utf-8?q?Tout=20plein=20de=20modifs,=20du=20m=C3=A9nage,=20des=20trucs=20en=20plus, =20plus=20beaux,=20moins=20moches,=20plus=20mieux=20et=20tout=20et=20tout=208-)?= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1.5.4.1" This is a multi-part message in MIME format. --------------1.5.4.1 Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://hugues@maison/opt/svn/private/hugues@382 a0e5b806-a6f9-0310-978d-cbce73f8a913 --- .zshrc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to '.zshrc') diff --git a/.zshrc b/.zshrc index 3643640..5ff5d81 100644 --- a/.zshrc +++ b/.zshrc @@ -23,11 +23,15 @@ ZDOTDIR=${ZDOTDIR:-~/.zsh} mkdir -p $ZDOTDIR +# Useful environment variables which may be used +# at any time - We compute them now to avoid calling +# the required processes each time we'll need. USER=${USER:-`whoami`} -HOST=${HOST:-$(hostname -s 2>/dev/null)} -DOMAIN=${DOMAIN:-${$(hostname -d 2>/dev/null):-$(hostname -y 2>/dev/null)}} +UID=${UID:-`id -u`} +HOST=${HOST:-$(hostname -s)} +DOMAIN=${DOMAIN:-${$(hostname -d):-$(hostname -y)}} -export USER HOST DOMAIN +export USER HOST DOMAIN UID if [ -d $ZDOTDIR ]; then for script in $ZDOTDIR/??_*.zsh @@ -36,7 +40,7 @@ if [ -d $ZDOTDIR ]; then [ "$DEBUG" != "" ] && echo "${${script:t:r}/??_/}... "; source $script - for i in "net:$DOMAIN" "host:$HOST" "user:$USER" + for i in "net:$DOMAIN" "host:$HOST" "user:$USER" "user:$SUDO_USER" do specific_script=${script:h}/$i/${${script:t}/??_/} if test -f $specific_script -- cgit v1.2.3