# Begin /etc/bashrc
# Written for Beyond Linux From Scratch
# by James Robertson <jameswrobertson@earthlink.net>
# updated by Bruce Dubbs <bdubbs@linuxfromscratch.org>

# System wide aliases and functions.

# System wide environment variables and startup programs should go into
# /etc/profile.  Personal environment variables and startup programs
# should go into ~/.bash_profile.  Personal aliases and functions should
# go into ~/.bashrc

# Provides a colored /bin/ls command.  Used in conjunction with code in
# /etc/profile.

alias ls='gls --color=auto'
alias la='gls -la --color=auto'
alias l='gls -l --color=auto'
alias ll='gls -laFo --color=auto'
alias g='gegrep -i --color=auto'
alias grep='ggrep --color=auto'
alias as=gas
alias ar=gar
alias addr2line=gaddr2line
alias arch=garch
alias base64=gbase64
alias basename=gbasename
alias cat=gcat
alias cc=gcc
alias chgrp=gchgrp
alias chmod=gchmod
alias chown=gchown
alias chroot=gchroot
alias cksum=gcksum
alias cmp=gcmp
alias comm=gcomm
alias cp=gcp
alias csplit=gcsplit
alias cut=gcut
alias date=gdate
alias dd=gdd
alias df=gdf
alias diff=gdiff
alias diff3=gdiff3
alias dir=gdir
alias dircolors=gdircolors
alias dirname=gdirname
alias dlltool=gdlltool
alias dllwrap=gdllwrap
alias du=gdu
alias echo=gecho
alias egrep='gegrep --color=auto'
alias elfedit=gelfedit
alias env=genv
alias expand=gexpand
alias expr=gexpr
alias factor=gfactor
alias false=gfalse
alias fgrep=gfgrep
alias find=gfind
alias fmt=gfmt
alias fold=gfold
alias gprof=ggprof
alias groups=ggroups
alias head=ghead
alias hostid=ghostid
alias hostname=ghostname
alias id=gid
alias install=ginstall
alias join=gjoin
alias kill=gkill
alias ld=gld
alias ld.bfd=gld.bfd
alias link=glink
alias ln=gln
alias locate=glocate
alias logname=glogname
alias m4=gm4
alias make=gmake
alias md5sum=gmd5sum
alias mkdir=gmkdir
alias mkfifo=gmkfifo
alias mknod=gmknod
alias mktemp=gmktemp
alias mv=gmv
alias nice=gnice
alias nl=gnl
alias nm=gnm
alias nohup=gnohup
alias nproc=gnproc
alias objcopy=gobjcopy
alias objdump=gobjdump
alias od=god
alias oldfind=goldfind
alias paste=gpaste
alias patch=gpatch
alias pathchk=gpathchk
alias pinky=gpinky
alias pr=gpr
alias printenv=gprintenv
alias printf=gprintf
alias ptx=gptx
alias pwd=gpwd
alias ranlib=granlib
alias readelf=greadelf
alias readlink=greadlink
alias rm=grm
alias rmdir=grmdir
alias runcon=gruncon
alias sdiff=gsdiff
alias sed=gsed
alias seq=gseq
alias sha1sum=gsha1sum
alias sha224sum=gsha224sum
alias sha256sum=gsha256sum
alias sha384sum=gsha384sum
alias sha512sum=gsha512sum
alias shred=gshred
alias shuf=gshuf
alias size=gsize
alias sleep=gsleep
alias sort=gsort
alias split=gsplit
alias stat=gstat
alias stdbuf=gstdbuf
alias strings=gstrings
alias strip=gstrip
alias stty=gstty
alias su=gsu
alias sum=gsum
alias sync=gsync
alias tac=gtac
alias tail=gtail
alias tar=gtar
alias tee=gtee
alias test=gtest
alias timeout=gtimeout
alias touch=gtouch
alias tr=gtr
alias true=gtrue
alias truncate=gtruncate
alias tsort=gtsort
alias tty=gtty
alias uname=guname
alias unexpand=gunexpand
alias uniq=guniq
alias unlink=gunlink
alias updatedb=gupdatedb
alias uptime=guptime
alias users=gusers
alias vdir=gvdir
alias wc=gwc
alias who=gwho
alias whoami=gwhoami
alias windmc=gwindmc
alias windrec=gwindres
alias xargs=gxargs
alias yacc=gyacc
alias yes=gyes
alias xx=exit
alias p='ps ax'
alias r='sudo bash'
alias switchoff='shutdown -y -i5 -g0'
alias restart='shutdown -y -i6 -g0'
alias wget='wget --no-check-certificate'

# Provides prompt for non-login shells, specifically shells started
# in the X environment. [Review the LFS archive thread titled
# PS1 Environment Variable for a great case study behind this script
# addendum.]

NORMAL="\[\e[0m\]"
RED="\[\e[1;31m\]"
GREEN="\[\e[1;32m\]"
if [[ $EUID == 0 ]] ; then
  PS1="$RED\u [ $NORMAL\w$RED ]# $NORMAL"
else
  PS1="$GREEN\u [ $NORMAL\w$GREEN ]\$ $NORMAL"
fi

# End /etc/bashrc
