dropdown menu

EXTRA - PROFILES

/etc/profile:
System wide profile.  All variables set here may be overridden by a user's personal .profile file in their $HOME directory. 
However, all commands here will be executed at login regardless.

#Extended history
export EXTENDED_HISTORY=ON
alias history='fc -lt'


$HOME/.profile:

export HOSTNAME=$(hostname)
export PWD=$(pwd)
export PS1="`whoami`@`hostname`: "'$PWD'" # "
export ENV=/.kshrc        <--ENV variable specifies which script (.kshrc) to be invoked every time a new shell is created

set -o vi

stty erase ^?

export PATH=$PATH:/usr/local/bin
export PATH=$PATH:/usr/DynamicLinkManager/bin

cat /etc/list
~/settitle "`hostname`"

alias mc=/usr/local/mc-4.6.0-AIX/bin/mc
alias nmon=/usr/local/nmon/nmon


##################################################
#Additional Info
##################################################
red=$(echo "\033[31m")
normal=$(echo "\033[00m")
export red normal

# Cluster check
lssrc -g cluster >/dev/null
if [ `echo $?` -eq 0 ]
then
echo "-----------------------------------------------------------------------------"
echo "           ${red}WARNING!!! This is a HACMP cluster node!"${normal}
echo "-----------------------------------------------------------------------------"
echo "The Resource Group(s) are in the following state:"
clRGinfo
fi
echo "-----------------------------------------------------------------------------"
echo

-----------------------------------------------
PS1 color settings:
If I want 'hostname' with other color in my PS1 (#export PS1="`whoami`@`hostname`: "'$PWD'" # ")

add before `hostname`: ^[[01;32m        <-it will set to green the color
                                       (in vi insert mode ctrl+v will make "^" and after that hit 'esc' it will do the first "[")
                                       (second "[" is a normal bracket)
add after `hostname`: ^[[0m            <-it will set back to original color (same keys as above)

-----------------------------------------------
After modification logout is necessary in order the changes take effect.

$HOME/.kshrc
This file (by default, but it can be overwritten in .profile ($ENV)) will be invoked every time a new shell is created. It is useful to define aliases in this file.

No comments: