![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| creating a new profile from command line | cleansing_flame | OS X (Apple) | 2 | 12-03-2007 05:57 PM |
| Command syntax | dsimpg1 | UNIX for Dummies Questions & Answers | 2 | 02-17-2005 10:13 AM |
| profile script | vascobrito | Shell Programming and Scripting | 2 | 04-02-2004 10:32 AM |
| command syntax | pmap | UNIX for Dummies Questions & Answers | 3 | 01-09-2002 07:06 AM |
| Syntax for tar command | baunocj | UNIX for Dummies Questions & Answers | 1 | 05-02-2001 07:05 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
profile script command syntax
Following is my /etc/profile script. Everything above the asterisks executes as expected. Nothing below the asterisks executes as I would like it to. Any guidance on what I'm doing wrong would be greatly appreciated :-)
#ident "@(#)profile 1.18 98/10/03 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 # Login and -su shells get /etc/profile services. # -rsh is given its environment in its .profile. case "$0" in -sh | -ksh | -jsh) 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 **************************************************** MAIL=/usr/mail/${LOGNAME:?} ORACLE_HOME=/scratch/oracle/8.1.7 export ORACLE_HOME ORACLE_SID=avoora2 JAVA_HOME=/usr/j2se export JAVA_HOME LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib export LD_LIBRARY_PATH TNS_NAMES=${ORACLE_HOME}/network/admin export TNS_NAMES PATH=/usr/local/bin:$ORACLE_HOME/bin:$PATH export PATH NLS_LANG=.UTF8 export NLS_LANG IM_HOME=/scratch/imuser/agentserver export IM_HOME echo "IM environent set" |
| Forum Sponsor | ||
|
|
|
|||
|
First thing - if you have those asterisks in the file they will cause a problem.
Second - you don't export the ORACLE_SID=avoora2. Third - it worked fine when I added it to my /etc/profile ( I only tested the following lines: ######################### MAIL=/usr/mail/${LOGNAME:?} ORACLE_HOME=/scratch/oracle/8.1.7 export ORACLE_HOME ORACLE_SID=avoora2 JAVA_HOME=/usr/j2se export JAVA_HOME LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib export LD_LIBRARY_PATH TNS_NAMES=${ORACLE_HOME}/network/admin export TNS_NAMES What is the shell and userid that you are testing? |
|
|||
|
Thanks - I'm using zsh, userid 1001 (serveruser). I was under the impression that etc/profile executed for every user login, and therefor expected to see the environment variables when executing "env" after a new login as serveruser, but I don't. Is there a more correct way to test this?
|
|
|||
|
Check the man page on profile.
(Care must be taken in providing system-wide services in /etc/profile. Personal .profile files are better for serv- ing all but the most global needs.) I was using a ksh to test your profile on Solaris 2.6. |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|