OSDN Git Service

Set $TMPDIR to /data/local/tmp, and use `id -un` to get the user's name.
authorElliott Hughes <enh@google.com>
Mon, 9 Feb 2015 20:25:41 +0000 (12:25 -0800)
committerElliott Hughes <enh@google.com>
Mon, 9 Feb 2015 20:25:41 +0000 (12:25 -0800)
Needed to make various command-line tools work out of the box, since we
don't have /tmp, which is what they'd naturally fall back to.

Change-Id: I3091d5ec9235f977de4a698a34f1f147a69e8a33

mkshrc

diff --git a/mkshrc b/mkshrc
index 4beaf90..98cbeac 100644 (file)
--- a/mkshrc
+++ b/mkshrc
@@ -6,8 +6,16 @@
 #
 # Support: https://launchpad.net/mksh
 
-: ${TERM:=xterm} ${HOME:=/data} ${MKSH:=/system/bin/sh} ${HOSTNAME:=$(getprop ro.product.device)}
-: ${SHELL:=$MKSH} ${USER:=$(typeset x=$(id); x=${x#*\(}; print -r -- ${x%%\)*})} ${HOSTNAME:=android}
+: ${HOME:=/data}
+: ${HOSTNAME:=$(getprop ro.product.device)}
+: ${HOSTNAME:=android}
+: ${MKSH:=/system/bin/sh}
+: ${SHELL:=$MKSH}
+: ${TERM:=xterm}
+: ${TMPDIR:=/data/local/tmp}
+: ${USER:=$(id -un)}
+export HOME HOSTNAME MKSH SHELL TERM TMPDIR USER
+
 if (( USER_ID )); then PS1='$'; else PS1='#'; fi
 PS4='[$EPOCHREALTIME] '; PS1='${|
        local e=$?
@@ -16,7 +24,6 @@ PS4='[$EPOCHREALTIME] '; PS1='${|
 
        return $e
 }$USER@$HOSTNAME:${PWD:-?} '"$PS1 "
-export HOME HOSTNAME MKSH SHELL TERM USER
 
 function hd {
        local -Uui16 -Z11 pos=0