- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Chapter III - User's environments and /etc/pro...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2010 03:49 AM
тАО02-26-2010 03:49 AM
SolutionYou have to set up the shell variables, as in
export ORACLE_HOME=...
export ORACLE_BASE=...
export ORACLE_SID=...
and so on.
>2. if the second - bash, what should i do to change shell from sh to bash?
You have to edit the file /etc/passwd
and modify the shell from the posix shell (usr/bin/sh) to bash
And edit the corresponding profile file.
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2010 12:56 PM
тАО02-26-2010 12:56 PM
Re: Chapter III - User's environments and /etc/profile
(BTW, the correct punctuation is "/", not "\". "\" is used in windows paths and on Unix for escaping.)
If you use a real shell (sh/ksh), ~/.profile should already be set up. You then can customize it the way you want, as Horia suggested.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-01-2010 09:06 PM
тАО03-01-2010 09:06 PM
Re: Chapter III - User's environments and /etc/profile
1. i checked passwd. The interpreter is /bin/bash
so why it didnt run the file .bash_pforile? or in passwd must be /usr/bin/bash?
2. my .bash_profile has these values:
# more .bash_profile
MANPATH=/usr/local/share/man:$MANPATH
EDITOR=vi
LESS="-efFKMX"
PS1='\u@\h \W\$ '
# DISPLAY=my_ip:666.0
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=prod
ORACLE_HOSTNAME=oraprod
NLS_LANG=_.AL32UTF8
TMP=/tmp/$LOGNAME
TMPDIR=/tmp/$LOGNAME
#
PATH=/usr/local/bin:$PATH:$ORACLE_HOME/bin
export PATH MANPATH EDITOR LESS ORACLE_HOME ORACLE_SID ORACLE_HOSTNAME TMP TMPDI R NLS_LANG
test -f ~/.aliases && . ~/.aliases
dat=`date +%Y-%m-%d_%H%M`
umask 022
so if i want to sh/ksh i have to copy these values and paste in .profile or ..?
regards,
rustam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-01-2010 11:03 PM
тАО03-01-2010 11:03 PM
Re: Chapter III - User's environments and /etc/profile
>1. i checked passwd. The interpreter is /bin/bash
>so why it didnt run the file .bash_pforile?
The only situation when bash does not interpret the profile file, is when the binary itself is called with --noprofile option.
>or in passwd must be /usr/bin/bash?
You must know where your shell binary exists (if it is /bin/bash or /usr/bin/bash). But if you are able to log into the machine as this user, I believe /bin/bash is your binary used as the shell. (You can use `find` or `which` in order to find out the exact location)
>so if i want to sh/ksh i have to copy these values and paste in .profile or ..?
Yes, you must add the following variables into your .profile:
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
ORACLE_SID=prod
ORACLE_HOSTNAME=oraprod
NLS_LANG=_.AL32UTF8
export ORACLE_HOME ORACLE_SID ORACLE_HOSTNAME NLS_LANG
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 01:18 AM
тАО03-02-2010 01:18 AM
Re: Chapter III - User's environments and /etc/profile
>so why it didn't run the file .bash_profile? or in passwd must be /usr/bin/bash?
Does ~/.bash_profile exist?
Typically there is a tlink that sets /bin to /usr/bin, so both bash paths should be fine.
>export PATH MANPATH EDITOR LESS ...
If you don't have to worry about the Bourne shell, you may want to use:
export MANPATH=/usr/local/share/man:$MANPATH
>if I want to sh/ksh I have to copy these values and paste in .profile or ..?
You can just use ~/.profile and not ~/.bash_profile. Or only put your bash specific stuff in ~/.bash_profile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-02-2010 03:25 AM
тАО03-02-2010 03:25 AM
Re: Chapter III - User's environments and /etc/profile
>> The only situation when bash does not interpret the profile file, is when the binary itself is called with --noprofile option.
how can i change noprofile option?
>>You must know where your shell binary exists (if it is /bin/bash or /usr/bin/bash).
bash exist in both directory.
>>I believe /bin/bash is your binary used as the shell.
How can i check current shell?
>> Does ~/.bash_profile exist?
Yeah, ~/.bash_profile exist and i typed content of this file above.
>> only put your bash specific stuff in ~/.bash_profile.
it was\is first way to solve problem, how?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-03-2010 01:44 AM
тАО03-03-2010 01:44 AM
Re: Chapter III - User's environments and /etc/profile
It isn't likely that option is used at all.
>bash exist in both directory.
More accurately they ARE the same directory.
>How can I check current shell?
ps -fp $$
Or type an invalid command as see if the shell name is in the error message.
>> only put your bash specific stuff in ~/.bash_profile.
>it was/is first way to solve problem, how?
If you always use ~/.profile, it can work for ksh/sh/base. Then if you need some fancy extra stuff for bash, add it to ~/.bash_profile.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-03-2010 08:19 PM
тАО03-03-2010 08:19 PM
Re: Chapter III - User's environments and /etc/profile
the command # ps -fp $$
returned me ... COMMAND
... bash
i determined through the $swlist that bash was installed.
I just want to activate bash and use .bash_profile for my user. Are there specific command to activate bash interpreter? In the passwd file i have this argument.
...:/home/oraprd:/bin/bash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-03-2010 08:44 PM
тАО03-03-2010 08:44 PM
Re: Chapter III - User's environments and /etc/profile
...:/home/oraprd:/bin/bash
Then that user will use the bash shell when they log in, if bash is really in the /bin directory.
NOTE: In HP-UX /bin is a link to /usr/bin. /bin/bash will work, if the link is present, but /usr/bin/bash is preferred.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-03-2010 09:03 PM
тАО03-03-2010 09:03 PM
Re: Chapter III - User's environments and /etc/profile
bash exist in /bin, /usr/bin/
when i'm typing wrong command, i get error:
# iffconfig
bash: iffconfig: command not found
so it means my shell is BASH right now. But it doesnt work ~/.profile when i switch
between users.
Regards,
Rustam