#!/bin/bash # ps1 # Script to specify PS1 for users # # Muhammad Ichsan http://michsan.web.id # Oct 2009 # BASE_DIR=/opt # Load library . $BASE_DIR/color-inc # To run this example, type: . color2 # color for user if [ $LOGNAME = $USER ]; then USR_COLOR=$white else USR_COLOR=$yellow fi # color for root only if [ $USER = 'root' ]; then USR_COLOR=$red fi #echo $USR_COLOR text='' text=$text`colorize '\u' $USR_COLOR -1 1` text=$text`colorize '@' $green -1 1` text=$text`colorize '\h' $yellow -1 0` text=$text`colorize ':\w' $white -1 1` text=$text'\n->> ' export PS1=$text