The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-12-2002
Registered User
 

Join Date: Feb 2002
Posts: 4
Stumble this Post!
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"
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-12-2002
thehoghunter
Guest
 

Posts: n/a
Stumble this Post!
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?
Reply With Quote
  #3 (permalink)  
Old 02-12-2002
Registered User
 

Join Date: Feb 2002
Posts: 4
Stumble this Post!
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?
Reply With Quote
  #4 (permalink)  
Old 02-12-2002
thehoghunter
Guest
 

Posts: n/a
Stumble this Post!
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:11 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0