Solaris 11 + PATH enviroments variables | Unix Linux Forums | Solaris

  Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

Solaris 11 + PATH enviroments variables

Solaris


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 09-29-2011
solaris_user solaris_user is offline
Registered User
 
Join Date: Aug 2009
Last Activity: 20 September 2014, 12:21 PM EDT
Location: Croatia
Posts: 440
Thanks: 32
Thanked 18 Times in 17 Posts
Solaris 11 + PATH enviroments variables

Ok, this is the little annoying.
I can't set up $PATH variable for all non root users on Solaris 11 express.


Code:
oracle@DevelopBox01:/export/home/oracle$ cat /etc/default/login 
........
# PATH sets the initial shell PATH variable
#
PATH=/usr/bin:/opt/DTT:/opt/DTT/bin:/opt/solstudio12.2/bin:/opt/solstudio12.2/bin/amd64:
/usr/bin:/usr/bin/amd64:/usr/local/bin:/usr/ddu/bin/i386:/usr/gnu/bin/amd64:/usr/gnu/bin:
/usr/has/bin:/usr/openwin/bin/amd64:/usr/openwin/bin:/usr/perl5/5.8.4/bin

and when I echo the variable then all I see is

Code:
oracle@DevelopBox01:/export/home/oracle$ echo $PATH
/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin

And I need to set only for user oracle certain varibles


Code:
oracle@DevelopBox01:/export/home/oracle$ grep ORACLE_ .login
ORACLE_BASE=/opt/oracle; export ORACLE_BASE
ORACLE_HOME="$(ORACLE_BASE)/product/10.2.0.1.0"; export ORACLE_HOME
ORACLE_SID oracle; export ORACLE_SID

and of course I don't how to set up something trivial like that, this varibles must be initialed upon login.
User shell is KSH93

Thanks

Last edited by solaris_user; 09-29-2011 at 02:00 PM.. Reason: fixed
Sponsored Links
    #2  
Old 09-29-2011
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
Moderator
 
Join Date: Jan 2007
Last Activity: 21 October 2014, 5:49 AM EDT
Location: Варна, България / Milano, Italia
Posts: 5,675
Thanks: 184
Thanked 620 Times in 578 Posts
As far as KornShell is concerned, I believe you need to modify different files:

Quote:
If the shell is invoked by exec(2), and the first character of argument zero ($0) is -, then the shell is assumed to be a login shell and commands are read from /etc/profile and then from either .profile in the current directory or $HOME/.profile, if either file exists.
Ref: KornShell 93 Manual Page
Sponsored Links
    #3  
Old 09-29-2011
plmachiavel plmachiavel is offline
Registered User
 
Join Date: Jun 2010
Last Activity: 20 October 2014, 4:34 PM EDT
Location: Canada
Posts: 46
Thanks: 9
Thanked 2 Times in 2 Posts
Do you have any PATH variable in the .profile?

My guess is that maybe it's something like

Code:
PATH=/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin

Where it should:

Code:
PATH=$PATH:/foo/bar

Can you cat the .profile to the forum?
    #4  
Old 10-01-2011
solaris_user solaris_user is offline
Registered User
 
Join Date: Aug 2009
Last Activity: 20 September 2014, 12:21 PM EDT
Location: Croatia
Posts: 440
Thanks: 32
Thanked 18 Times in 17 Posts

Code:
oracle@DevelopBox01:/export/home/oracle$ cat .profile 
#
# Simple profile places /usr/gnu/bin at front,
# adds /usr/X11/bin, /usr/sbin and /sbin to the end.
#
# Use less(1) as the default pager for the man(1) command.
#
export PATH=/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin
export PAGER="/usr/bin/less -ins"

#
# Define default prompt to <username>@<hostname>:<path><"($|#) ">
# and print '#' for user "root" and '$' for normal users.
#
PS1='${LOGNAME}@$(/usr/bin/hostname):$(
    [[ "${LOGNAME}" == "root" ]] && printf "%s" "${PWD/${HOME}/~}# " ||
    printf "%s" "${PWD/${HOME}/~}\$ ")

Sponsored Links
    #5  
Old 10-02-2011
plmachiavel plmachiavel is offline
Registered User
 
Join Date: Jun 2010
Last Activity: 20 October 2014, 4:34 PM EDT
Location: Canada
Posts: 46
Thanks: 9
Thanked 2 Times in 2 Posts
The variable PATH is being overwritten on login via the current .login file.

Put the following line instead of what's present and that will do it:


Code:
export PATH=$PATH:/usr/gnu/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin

Wanna test it before editing your file? Try the following at the prompt:

Code:
export PATH=$PATH:/usr/bin:/opt/DTT:/opt/DTT/bin:/opt/solstudio12.2/bin:/opt/solstudio12.2/bin/amd64:
/usr/bin:/usr/bin/amd64:/usr/local/bin:/usr/ddu/bin/i386:/usr/gnu/bin/amd64:/usr/gnu/bin:
/usr/has/bin:/usr/openwin/bin/amd64:/usr/openwin/bin:/usr/perl5/5.8.4/bin

and then
Code:
echo $PATH


Hope it fixes your problem.

Thanks Jlliagre, I did not notice this one ...

Last edited by plmachiavel; 10-03-2011 at 08:12 AM..
Sponsored Links
    #6  
Old 10-03-2011
jlliagre jlliagre is offline Forum Advisor  
ɹǝsn sıɹɐlos
 
Join Date: Dec 2007
Last Activity: 21 October 2014, 11:50 AM EDT
Location: Paris
Posts: 4,431
Thanks: 16
Thanked 473 Times in 427 Posts
You should remove some unnecessary paths and add some others:

Code:
export PATH=/usr/bin:/usr/sbin:/sbin:/opt/DTT/bin:/opt/solstudio12.2/bin:
/usr/bin:/usr/local/bin:/usr/ddu/bin/i386:/usr/gnu/bin:/usr/openwin/bin:/usr/perl5/5.8.4/bin

---------- Post updated at 07:33 ---------- Previous update was at 07:31 ----------

Quote:
Originally Posted by plmachiavel View Post
Try the following at the prompt:

Code:
export PATH:$PATH:/usr/bin:/opt/DTT:/opt/DTT/bin:...

Typo:

Code:
export PATH=$PATH:/usr/bin:/opt/DTT:/opt/DTT/bin:...

Sponsored Links
    #7  
Old 10-07-2011
solaris_user solaris_user is offline
Registered User
 
Join Date: Aug 2009
Last Activity: 20 September 2014, 12:21 PM EDT
Location: Croatia
Posts: 440
Thanks: 32
Thanked 18 Times in 17 Posts
Thanks, I successfully setted my PATH variable but for some reason Oracle database 10 won't start. I am going to try with some other database, it is for my college purposes only and I want a good knowledge in databse field. Will try with databse 11 but requires too much RAM.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
unix Library path variables. anilcliff Shell Programming and Scripting 5 06-28-2011 08:36 AM
Shell Path Autocomplete w/ Variables acheong87 Shell Programming and Scripting 1 02-23-2009 09:47 AM
path variables sszd UNIX for Dummies Questions & Answers 6 12-18-2007 12:45 PM
Solaris 10.0 PATH environment XNOR UNIX for Dummies Questions & Answers 10 04-09-2007 11:24 PM
path name for Solaris 8 ? phapvn UNIX for Advanced & Expert Users 3 11-28-2001 11:31 AM



All times are GMT -4. The time now is 02:23 PM.