Escape into the Net

29/04/2006 - Come see my adventures in cyberspace. This blog may tend to have a technical slant to it at times. At others, something I find interesting that I think should be noted rather than one of my other journals. Old description:Come read some accounts of my online adventures in cyberspace, at times you'll cross over into the real world with me too.

Location: Sudbury, ON, Canada

Wednesday, March 10, 2010

a bit of bash to add useful colouring when logged in, depending on account

# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc

# If id command returns zero, youve root access.
if [ $(id -u) -eq 0 ];
then # you are root, set red colour prompt
PS1="\\[$(tput setaf 1)\\]\\u@\\h:\\w #\\[$(tput sgr0)\\]"
else # normal
PS1="[\\u@\\h:\\w] $"