bash: Update default environment
* Match mksh * Use colored ls Change-Id: I2ed8617d348344f2cfae6e896981ce4759fffaef
This commit is contained in:
13
etc/bashrc
13
etc/bashrc
@@ -5,6 +5,12 @@
|
|||||||
# that can't tolerate any output. So make sure this doesn't display
|
# that can't tolerate any output. So make sure this doesn't display
|
||||||
# anything or bad things will happen !
|
# anything or bad things will happen !
|
||||||
|
|
||||||
|
: ${HOME:=/sdcard}
|
||||||
|
: ${HOSTNAME:=$(getprop ro.cm.device)}
|
||||||
|
: ${TERM:=linux}
|
||||||
|
: ${TMPDIR:=/data/local/tmp}
|
||||||
|
: ${USER:=$(id -un)}
|
||||||
|
export HOME HOSTNAME MKSH SHELL TERM TMPDIR USER
|
||||||
|
|
||||||
# Test for an interactive shell. There is no need to set anything
|
# Test for an interactive shell. There is no need to set anything
|
||||||
# past this point for scp and rcp, and it's important to refrain from
|
# past this point for scp and rcp, and it's important to refrain from
|
||||||
@@ -25,10 +31,6 @@ shopt -s histappend
|
|||||||
|
|
||||||
use_color=false
|
use_color=false
|
||||||
|
|
||||||
# set some environment variables
|
|
||||||
export HOME=/sdcard
|
|
||||||
export TERM=xterm
|
|
||||||
|
|
||||||
# enable colorful terminal
|
# enable colorful terminal
|
||||||
if [[ ${EUID} == 0 ]] ; then
|
if [[ ${EUID} == 0 ]] ; then
|
||||||
PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
|
PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
|
||||||
@@ -36,6 +38,9 @@ else
|
|||||||
PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
|
PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
alias ls='ls --color=auto'
|
||||||
|
alias ps='/system/xbin/ps'
|
||||||
|
|
||||||
# Try to keep environment pollution down, EPA loves us.
|
# Try to keep environment pollution down, EPA loves us.
|
||||||
unset use_color safe_term match_lhs
|
unset use_color safe_term match_lhs
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user