cvpcs | 36c1272 | 2010-06-03 14:18:57 -0500 | [diff] [blame] | 1 | # /etc/bash/bashrc |
| 2 | # |
| 3 | # This file is sourced by all *interactive* bash shells on startup, |
| 4 | # including some apparently interactive shells such as scp and rcp |
| 5 | # that can't tolerate any output. So make sure this doesn't display |
| 6 | # anything or bad things will happen ! |
| 7 | |
| 8 | |
| 9 | # Test for an interactive shell. There is no need to set anything |
| 10 | # past this point for scp and rcp, and it's important to refrain from |
| 11 | # outputting anything in those cases. |
| 12 | if [[ $- != *i* ]] ; then |
| 13 | # Shell is non-interactive. Be done now! |
| 14 | return |
| 15 | fi |
| 16 | |
| 17 | # Bash won't get SIGWINCH if another process is in the foreground. |
| 18 | # Enable checkwinsize so that bash will check the terminal size when |
| 19 | # it regains control. #65623 |
| 20 | # http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11) |
| 21 | shopt -s checkwinsize |
| 22 | |
| 23 | # Enable history appending instead of overwriting. #139609 |
| 24 | shopt -s histappend |
| 25 | |
cvpcs | d158645 | 2010-06-06 18:06:59 -0500 | [diff] [blame] | 26 | use_color=false |
| 27 | |
| 28 | # set some environment variables |
Dan Pasanen | d877b77 | 2014-10-06 12:39:24 -0500 | [diff] [blame] | 29 | export HOME=/sdcard |
| 30 | export TERM=xterm |
cvpcs | d158645 | 2010-06-06 18:06:59 -0500 | [diff] [blame] | 31 | |
| 32 | # enable colorful terminal |
| 33 | if [[ ${EUID} == 0 ]] ; then |
| 34 | PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] ' |
| 35 | else |
| 36 | PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] ' |
| 37 | fi |
cvpcs | 36c1272 | 2010-06-03 14:18:57 -0500 | [diff] [blame] | 38 | |
| 39 | # Set up a ton of aliases to cover toolbox with the nice busybox |
| 40 | # equivalents of its commands |
Scott Anderson | 4354886 | 2011-02-09 10:58:16 -0500 | [diff] [blame] | 41 | for i in cat chmod chown df insmod ln lsmod mkdir mount mv rm rmdir rmmod umount; do |
| 42 | eval alias ${i}=\"busybox ${i}\" |
| 43 | done |
| 44 | unset i |
Firerat | 5e48b32 | 2011-08-08 23:00:00 +0100 | [diff] [blame] | 45 | alias ls='busybox ls --color=auto' |
Scott Anderson | e573009 | 2011-02-09 11:06:30 -0500 | [diff] [blame] | 46 | alias sysro='mount -o remount,ro /system' |
| 47 | alias sysrw='mount -o remount,rw /system' |
cvpcs | 36c1272 | 2010-06-03 14:18:57 -0500 | [diff] [blame] | 48 | |
cvpcs | 36c1272 | 2010-06-03 14:18:57 -0500 | [diff] [blame] | 49 | # Try to keep environment pollution down, EPA loves us. |
| 50 | unset use_color safe_term match_lhs |
cvpcs | d158645 | 2010-06-06 18:06:59 -0500 | [diff] [blame] | 51 | |
Tanguy Pruvot | 61d7e02 | 2014-10-06 12:41:47 -0500 | [diff] [blame] | 52 | resize |