]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
shell/env: Prefer ~/.tmp to ~/tmp as TMPDIR.
authorSimon Ruderich <simon@ruderich.org>
Wed, 9 Feb 2011 14:28:47 +0000 (15:28 +0100)
committerSimon Ruderich <simon@ruderich.org>
Wed, 9 Feb 2011 14:28:47 +0000 (15:28 +0100)
shell/env

index d478b17d8b9c5c69844980e38a3549fda3bb2701..c1a950e70a465c188558f552f81306851a15fdda 100644 (file)
--- a/shell/env
+++ b/shell/env
@@ -28,9 +28,15 @@ export EDITOR
 PAGER=less
 export PAGER
 
-# Use ~/tmp as directory for temporary files if available to reduce security
+# Use ~/.tmp as directory for temporary files if available to reduce security
 # problems on multi-user systems.
-if [ -O ~/tmp -a -d ~/tmp ]; then
+if [ -O ~/.tmp -a -d ~/.tmp ]; then
+    TMP=~/.tmp
+    TEMP=$TMP
+    TMPDIR=$TMP
+    export TMP TEMP TMPDIR
+# Also try ~/tmp as fallback.
+elif [ -O ~/tmp -a -d ~/tmp ]; then
     TMP=~/tmp
     TEMP=$TMP
     TMPDIR=$TMP