511d60900a
At present, when running a busybox shell ("busybox sh") from mksh (/system/bin/sh), one gets the following message before every command line: sh: precmd: Permission denied This is due to mkshrc exporting a PS1 which depends on a mkshrc defined function, "precmd". Since "busybox sh" does not source mkshrc, it does not have this function defined, resulting in the above error. By not exporting PS1, "busybox sh" uses its own reasonable default. mksh subshells continue to work as usual, since they (re)source /etc/mkshrc anyways. Change-Id: Ic9182e42aa033e811300d9e6e8d6d3f43e14e58f
29 lines
726 B
Text
29 lines
726 B
Text
# Copyright (c) 2010
|
|
# Thorsten Glaser <t.glaser@tarent.de>
|
|
# This file is provided under the same terms as mksh.
|
|
#-
|
|
# Minimal /system/etc/mkshrc for Android
|
|
|
|
: ${TERM:=vt100} ${HOME:=/data} ${MKSH:=/system/bin/sh} ${HOSTNAME:=android}
|
|
: ${SHELL:=$MKSH} ${USER:=$(typeset x=$(id); x=${x#*\(}; print -r -- ${x%%\)*})}
|
|
if (( USER_ID )); then PS1='$'; else PS1='#'; fi
|
|
function precmd {
|
|
typeset e=$?
|
|
|
|
(( e )) && print -n "$e|"
|
|
}
|
|
PS1='$(precmd)$USER@$HOSTNAME:${PWD:-?} '"$PS1 "
|
|
export HOME HOSTNAME MKSH SHELL TERM USER
|
|
alias l='ls'
|
|
alias la='l -a'
|
|
alias ll='l -l'
|
|
alias lo='l -a -l'
|
|
|
|
for p in ~/.bin; do
|
|
[[ -d $p/. ]] || continue
|
|
[[ :$PATH: = *:$p:* ]] || PATH=$p:$PATH
|
|
done
|
|
|
|
unset p
|
|
|
|
: place customisations above this line
|