.profile file on each terminal


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users .profile file on each terminal
# 1  
Old 02-14-2011
.profile file on each terminal

Hello All,

I create an oracle user, on my Solaris OS.
i modified my .profile file on the oracle home.
the problem that each time i want my variables to work, ORACLE_HOME, ORACLE_BASE ...
i have to run the .profile file (. ./.profile) and each time i exit the terminal i have to run again so my environment variables take place.

How can i save the settings?

Regards,
# 2  
Old 02-14-2011
you have an "exit" command in your .profile ??
# 3  
Old 02-14-2011
.profile file on each terminal

below is my .profile file.

Code:
#ident    "@(#)profile    1.19    01/03/13 SMI"    /* SVr4.0 1.3    */

# The profile that all logins get before using their own .profile.

trap ""  2 3
export LOGNAME PATH

if [ "$TERM" = "" ]
then
    if /bin/i386
    then
        TERM=sun-color
    else
        TERM=sun
    fi
    export TERM
fi


ORACLE_BASE=/data/oracle/ora11g
ORACLE_HOME=/data/oracle/ora11g/product/11.2.0/dbhome_1
ORACLE_DOC=${ORACLE_HOME}/doc
ORA_NLS33=${ORACLE_HOME}/ocommon/nls/admin/data
PATH=$PATH:${ORACLE_HOME}/bin:/usr/ccs/bin:/usr/bin:/usr/sbin:/etc:/usr/lbin:/usr/openwin/bin:/usr/ucb:/sbin
export ORACLE_BASE
export ORACLE_HOME
export ORACLE_DOC
export ORA_NLS33
export PATH
LD_LIBRARY_PATH=/data/oracle/ora11g/product/11.2.0/dbhome_1/lib32
export LD_LIBRARY_PATH
LIBPATH=/data/oracle/ora11g/product/11.2.0/dbhome_1/lib32
export LIBPATH


#    Login and -su shells get /etc/profile services.
#    -rsh is given its environment in its .profile.

case "$0" in
-sh | -ksh | -jsh | -bash)

    if [ ! -f .hushlogin ]
    then
        /usr/sbin/quota
        #    Allow the user to break the Message-Of-The-Day only.
        trap "trap '' 2"  2
        /bin/cat -s /etc/motd
        trap "" 2

        /bin/mail -E
        case $? in
        0) 
            echo "You have new mail."
              ;;
        2) 
            echo "You have mail."
               ;;
        esac
    fi
esac

umask 022
trap  2 3


Last edited by DukeNuke2; 02-14-2011 at 11:11 AM..
# 4  
Old 02-14-2011
don't you miss a ;; between the 2 lines :
Code:
fi
esac

# 5  
Old 02-14-2011
.profile file on each terminal

i copied the file from /etc
and just i add it the ORACLE part to it
# 6  
Old 02-14-2011
Not sure about that, but maybe if the /etc/profile is found it is executed and the other .profile are not.
# 7  
Old 02-15-2011
Quote:
Originally Posted by beayni33
Hello All,

I create an oracle user, on my Solaris OS.
i modified my .profile file on the oracle home.
the problem that each time i want my variables to work, ORACLE_HOME, ORACLE_BASE ...
i have to run the .profile file (. ./.profile) and each time i exit the terminal i have to run again so my environment variables take place.

How can i save the settings?

Regards,
  1. What shell are you using?
  2. When you exit the terminal are you still logged in as oracle user? Do you log out at all?
The .profile file is only read at login. If you don't log out it won't be read automatically.

If you are using bash it may not read the .profile file at all, especially if you have a .bash_profile file.

Andrew
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print Terminal Output Exactly how it Appears in the Terminal to a New Text File

Hello All, I have a text file containing output from a command that contains lots of escape/control characters that when viewed using vi or view, looks like jibberish. But when viewed using the cat command the output is formatted properly. Is there any way to take the output from the cat... (7 Replies)
Discussion started by: mrm5102
7 Replies

2. UNIX for Dummies Questions & Answers

Modify .profile file

Hi there, I am really new to unix (about 3 days using it). In my assignment spec i have been told to modify my .profile file and create an environmental file. Until now all tasks have been file manipulation, etc learn how to use chmod or grep etc. I literally can't find this .profile file, I... (1 Reply)
Discussion started by: paulbuckley221
1 Replies

3. UNIX for Dummies Questions & Answers

No .profile file

Hi All, I just have a small question. I was wondering what would happen if there was no .profile file. I understand that the aliases and my path related commands wouldnt work, however i wanted to know if i would still be able to use the ls,cp,mv.... commands without a .profile file. If... (3 Replies)
Discussion started by: raghu_shekar
3 Replies

4. Infrastructure Monitoring

trap in etc/profile and user .profile

Hello I really wonder what's trap in etc/profile and in each user .profile. I try to google for it but I think I have no luck. Mostly hit is SNMP traps which I think it is not the same thing. I want to know ... 1. What's a "trap 2 3" means and are there any other value I can set... (4 Replies)
Discussion started by: Smith
4 Replies

5. AIX

Which file has the user profile?

It's been a long time since I've done this and I can't remember which file is needed to edit. I would like to change the prompt for a user on my AIX 5.3 box, but I don't see a .profile file or a rc.ksh file to edit. Which file do I need to edit to get this? (1 Reply)
Discussion started by: bbbngowc
1 Replies

6. Shell Programming and Scripting

Profile File in Unix

Hi, I have to run a sqr program. In the profile file everything is set. e.g APPLID=personel APPPATH=/${ENVIRONMENT}/${APPPATH} and so on.. SQRDIR=/opt/sqr/bin/syb Still when I'm running this script,its giving error APPLID not set and SQRDIR not set. Any idea,why? TIA (5 Replies)
Discussion started by: autosys_nm
5 Replies

7. Shell Programming and Scripting

Can I modify the .bashrc file instead of .profile file to customize my login?

Hello, I got this question which tells me to customize my login script. Some people in the forums suggested to modify the .profile file in my home directory. I did so, but none of my customizations show up when I open the terminal after. So, I tried to modify other files in my home directory,... (1 Reply)
Discussion started by: Hyunkel
1 Replies

8. UNIX for Dummies Questions & Answers

xterm or terminal profile

Hi all I want to customize my terminal or xterminal profile for background color font color and font face etc. As far as I know for login .profile must be placed on top your home directory and I did it and worked. But I am not sure for terminal; what is the name of profile that I've to... (6 Replies)
Discussion started by: xramm
6 Replies

9. Shell Programming and Scripting

Invoke Terminal Without Profile

Hey, I need to open a terminal via a shell script, but i need it to not read any of the start up files. So far I was thinking something along the lines of this but it was unsuccessfull !#bin/sh /Applications/Utilities/Terminal.app/Contents/MacOS/Terminal --noprofile any ideas on how to... (0 Replies)
Discussion started by: meskue
0 Replies

10. UNIX for Dummies Questions & Answers

changed .profile but didnt ./.profile, yet reflected changes

hi , i added ls -F to .profile. and i need to do ./.profile for the effect to take effect BUT i didnt and YET the next day when i came to work and log in, the changes took effect. i am on aix. please explain.. thanks (4 Replies)
Discussion started by: yls177
4 Replies
Login or Register to Ask a Question