From 6a07e41ec6be668ef2719454cce312b8cda32d18 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 3 Aug 2012 16:33:22 +0900 Subject: [PATCH] fix tmpdir --- bashrc | 5 ++--- profile | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/bashrc b/bashrc index 2207bf4..f56118e 100755 --- a/bashrc +++ b/bashrc @@ -48,8 +48,7 @@ export VISUAL="$EDITOR" export GIT_PAGER="$PAGER" export GIT_EDITOR="$EDITOR" -export TMP="/tmp/${USER}-tmp" -export TEMP="$TMP" +test -z "$TMP" && export TMP=/tmp/${USER}-tmp mkdir -p "$TMP" ! iswindows && null type stty && { @@ -446,7 +445,7 @@ __my_ps1_ipaddr(){ } __my_ps1_bttry(){ local last=$? - local bst="$TMP/batterystatus" + local bst="${TMP}/batterystatus" if test -z "$DISPLAY" && ! iswindows then test -f $bst && local bstr="$(cat $bst)" diff --git a/profile b/profile index e07090a..c67932c 100755 --- a/profile +++ b/profile @@ -26,4 +26,6 @@ __add_to_path ${HOME}/.local/bin /c/mingw/bin /c/mingw/msys/1.0/bin type setterm >/dev/null 2>&1 && setterm -blank 30 -powersave on # -powerdown 10 # in my environment powerdown does not work -mkdir -p "/tmp/$USER-tmp" +export TMP="/tmp/${USER}-tmp" +export TEMP="$TMP" +mkdir -p "$TMP"