- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Chapter III - User's environments and /etc/profile
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
Forums
Discussions
Discussions
Discussions
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
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2010 11:33 PM
03-03-2010 11:33 PM
Re: Chapter III - User's environments and /etc/profile
>How can I check current shell?
When you are using bash, it defines a variable named "BASH".
Sample:
This user have posix shell as login shell
# set |grep bash
_=bash
He likes to use bash. afther enetering bash shell, the variable is defined:
# bash
# set |grep bash
BASH=/usr/local/bin/bash
_=/usr/local/bin/bash
#
>But it doesnt work ~/.profile when i switch
between users.
What do you mean by "i switch between users."?
~/.profile it is sourced by shell only when the shell it is invoked as a login shell.
If you invoke the shell as a subshell, .profile is not interpreted.
All put together, if you "switch" between users like this:
su new_user
The .profile would not be sourced.
If you call su like this
su - new_user
you would get the expected behavior.
Please read the documentation - man pages.
It is a must for every administrator (novice or expert).
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2010 11:37 PM
03-03-2010 11:37 PM
Re: Chapter III - User's environments and /etc/profile
#bash
#source ~/.profile
This would set the variables defined in that .profile file.
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2010 01:51 AM
03-04-2010 01:51 AM
Re: Chapter III - User's environments and /etc/profile
If you are using NIS to share between HP-UX and Linux, it'll work better with /bin/.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2010 05:59 AM
03-04-2010 05:59 AM
Re: Chapter III - User's environments and /etc/profile
True, but aren't the /bin and /lib transition links supposed to go away at some point?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2010 04:09 AM
03-05-2010 04:09 AM
Re: Chapter III - User's environments and /etc/profile
No, after more than a decade Tlinks were changed to be permanent on 11.31.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2010 04:30 AM
03-05-2010 04:30 AM
Re: Chapter III - User's environments and /etc/profile
i've done these steps today:
1. changed passwd file more exactly value for my oracle user
from
oralce:*:*:*:*:/home/oracle:/bin/bash
to
oralce:*:*:*:*:/home/oracle:/usr/local/bin/bash
so i have bash SHELL right now.
And now i found out that script which i mentioned above is wrong(i guess). Now i have to think about how to change my script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2010 04:41 AM
03-05-2010 04:41 AM
Re: Chapter III - User's environments and /etc/profile
>oralce:*:*:*:*:/home/oracle:/bin/bash
>to
>oralce:*:*:*:*:/home/oracle:/usr/local/bin/bash
Maybe /bin/bash and /usr/local/bin/bash are the same binary.
In order to find out:
ll /bin/bash /usr/local/bin/bash
What does it tell you , /bin/bash is a symlink?
>so i have bash SHELL right now.
I believe oralce user had bash login shell even before you did the changes in /etc/passwd
>And now i found out that script which i mentioned above is wrong(i guess). Now i have to think about how to change my script.
What script are you talking about?
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2010 06:06 AM
03-05-2010 06:06 AM
Re: Chapter III - User's environments and /etc/profile
----
in my first post i brought part code from my script.
In upload photo i gave whole code. These code must be load when i login with oracle user. But doesn't work. Maybe there some mistakes.
p.s. i deleted some values such as display's, oracle_sid's, oracle_home's.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2010 01:44 PM
03-05-2010 01:44 PM
Re: Chapter III - User's environments and /etc/profile
This would be the .bash_profile file, right?
And you have put it in this directory:
/home/oracle
I mean, as root:
cat /home/oracle/.bash_profile
would list the content from your last attached picture, right?
Can you be more specific? What exactly does not work? What is the content of ~/.aliases ?
DISPLAY variable (if defined) should also be exported.
I believe you understand what I was talking about in my previous post:
"
What do you mean by "i switch between users."?
~/.profile it is sourced by shell only when the shell it is invoked as a login shell.
If you invoke the shell as a subshell, .profile is not interpreted.
All put together, if you "switch" between users like this:
su new_user
The .profile would not be sourced.
If you call su like this
su - new_user
you would get the expected behavior.
Please read the documentation - man pages.
It is a must for every administrator (novice or expert).
"
Just play yourself with those settings in order to get a better picture.
Horia.
Horia.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2010 03:52 PM
03-05-2010 03:52 PM
Re: Chapter III - User's environments and /etc/profile
FYI: While a picture may be worth a thousand words, an attached text file is golden and can be manipulated and quoted.
As Horia asked, what doesn't work?
You can also add "set -x" (at least in a real shell) to trace execution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2010 09:41 PM
03-08-2010 09:41 PM
Re: Chapter III - User's environments and /etc/profile
>>All put together, if you "switch" between users like this:
su new_user
The .profile would not be sourced.
If you call su like this
su - new_user
i called su - oracle and file ~./bash_profile worked correctly and got everything which are in file.
Thanks a lot Horia and Dennis.
- « Previous
-
- 1
- 2
- Next »