summaryrefslogtreecommitdiff
path: root/.zshrc
diff options
context:
space:
mode:
authorhugues <hugues@a0e5b806-a6f9-0310-978d-cbce73f8a913>2007-05-16 10:17:44 +0000
committerHugues Hiegel <hugues@hiegel.fr>2008-03-07 14:15:11 +0100
commit72896f1d1d0ae633d360aede3956d42036fd600d (patch)
treea6a94a70c15918a416dae7e8504aea7fb95543ac /.zshrc
parente9962a5ffdc774468cfb3fd09a2dfe03190e5ad2 (diff)
=?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
Diffstat (limited to '.zshrc')
-rw-r--r--.zshrc12
1 files changed, 8 insertions, 4 deletions
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