LOCATION :
Home directory of the user
SIGNIFICANCE :
> To set environment variables and shell options such as $PATH
> Executed whenever you login
IMPORTANT POINTS :
> we can also put command aliases in the Profile file, but it's better to put them in a separate file -- commonly called .env
> .profile settings overwrite those in /etc/profile (/etc/profile file is system wide initialization file, executed for login shells.).
> Basically, if you need to load shell variables from any file just run the . (dot) command, followed by space and (the absolute path is necessary) the path to the file. (Be carefull what file you're loading variables from because you meight overwrite some important environment variables and your system could become unstable) ( for example . appdtier , . dbtier).
> You can check the home directory of the user by below command
root> cat /etc/passwd|grep oracle
oracle:x:106:20001::/home/oracle:/bin/ksh
so in this case we would add a dot-file called .profile in /home/oracle
> Other dot-file depend on the shell specified in /etc/passwd:
.profile (sh, ksh, bash)
.cshrc (csh)
.login (use for csh programs)
FILE :
#########################################################################################################
# @(#) $Revision: 72.2 $
# Default user .profile file (/usr/bin/sh initialization).
# Set up the terminal:
if [ "$TERM" != "dumb" ]
then
tabs
fi
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m :hp `
else
eval ` tset -s -Q `
fi
stty erase "^H" kill "^U" intr "^C" eof "^D" susp "^Z"
stty hupcl ixon ixoff
# tabs
# Set up the search paths:
PATH=/opt/aCC/bin:$PATH:.
# Set up the shell environment:
set -u
trap "echo 'logout'" 0
# Set up the shell variables:
EDITOR=vi
export EDITOR
HOSTNAME=${HOSTNAME:-`hostname`}
export LOGNAME HOSTNAME
fname=`date +%b%d:%H%M`
Aliases are used to rename commands (like alias search=grep), and sometimes to include options. You can put aliases in your Profile file, but if you do, they will not be "exported" to subshells. So it's better to put them in a separate file in your home directory, commonly called .env, and execute the .env file from your Profile. In this . profile we don't have any alias
Remember : no space before or after the equal sign
HISTSIZE=1024; export HISTSIZE
History expansion allows you to use words from previous command lines in the command line you are typing. This simplifies spelling corrections and the repetition of complicated commands or arguments. Immediately before execution, each command is saved in the history list, the size of which is controlled by the HISTSIZE parameter. The one most recent command is always retained in any case. Each saved command in the history list is called a history _event_ and is assigned a number, beginning with 1 (one) when the shell starts up.
# set default printer
#LPDEST=ams_hp5s_1285
Another useful variable is PRINTER/LPDEST, which selects a default print destination.
#export LPDEST
export PS1=`whoami`':'`hostname`':${TWO_TASK:-""}:${ORACLE_SID:-""}:'
Sets the first prompt string (PS1) to tell you the current directory and changes the prompt from $ to: the name of the current directory ($PWD) followed by :-
export PATH
PATH=/opt/java1.2/bin:/opt/tar/bin:/opt/aCC/bin:/usr/sbin:$PATH
export PATH
The PATH environment variable is a colon-delimited list of directories that your shell searches through when you enter a command.Program files (executables) are kept in many different places on the Unix system. Your path tells the Unix shell where to look on the system when you request a particular program. Having more directories in your path will reduce the number of times you get "Command not found" errors, but might put you at greater risk of activating a Trojan horse.If you are using sh, ksh, or bash, at the shell prompt, to modify it enter:
PATH=$PATH\:/dir/path ; export PATH
Note: The earlier entries in the path take precedence over the later ones. If you want the directories you add to your path to take precedence, in the examples above, replace $PATH\:/dir/path with /dir/path:$PATH
.PATH=/dir/path:$PATH ; export PATH
To make these changes permanent, add the commands described above to the end of your .cshrc file (for csh and tcsh), .profile file (for shand ksh), or .bash_profile file (for bash).
HISTFILE=$HOME/.sess_history/.${HOSTNAME}hist.$(who am i |cut -d " " -f 1):${fname}
HISTFILE parameter can also be defined to define the location where history info will be saved.
#####################################################################################################
-----------------------------------------------------
# .oracle10g
### Oracle specific setup
ORACLE_HOME=/opt/oracle10g/instantclient_10_2
TNS_ADMIN=/opt/oracle10g/instantclient_10_2
NLS_LANG=_.WE8ISO8859P1
export ORACLE_HOME TNS_ADMIN NLS_LANG
LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
PATH=$ORACLE_HOME:$PATH
export PATH
### End Oracle specific setup