- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- 11iv3 PATH not getting setup from /etc/PATH
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
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
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
11-06-2014 10:48 PM - last edited on 11-09-2014 08:19 PM by Lisa198503
11-06-2014 10:48 PM - last edited on 11-09-2014 08:19 PM by Lisa198503
Hi in 11iv3 PATH not getting setup from /etc/PATH
Whem am running env for 1 user am not able to see /etc/PATH contents :
$ env|grep -i pat
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/opt/ssh/bin:.
Whereas my /etc/PATH contains ;
root #/var/tmp >cat /etc/PATH
/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin:/opt/gvsd/bin:/opt/ipf/bin:/opt/nettladm/bin:/opt/fcms/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/sas/bin:/opt/wli/bin:/opt/graphics/common/bin:/opt/hpvm/bin:/opt/atok/bin:/usr/bin/X11:/usr/contrib/bin/X11:/opt/sec_mgmt/bastille/bin:/opt/caliper/bin:/opt/drd/bin:/opt/dsau/bin:/opt/dsau/sbin:/opt/resmon/bin:/opt/firefox:/opt/perf/bin:/usr/contrib/kwdb/bin:/opt/perl_32/bin:/opt/perl_64/bin:/opt/prm/bin:/opt/propplus/bin:/opt/sfm/bin:/etc/cmcluster/scripts/tkit/vtn:/opt/swm/bin:/opt/sec_mgmt/spc/bin:/opt/ssh/bin:/opt/swa/bin:/opt/hpsmh/bin:/opt/thunderbird:/opt/sentinel/bin:/opt/langtools/bin:/opt/wlm/bin:/opt/gwlm/bin:/opt/cfg2html:/home/scripts:/usr/local/bin:/opt/gnome/bin
P.S. This thread has been moved from HP-UX>System Administration to HP-UX > languages. -HP Forum Moderator
Solved! Go to Solution.
- Tags:
- PATH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2014 12:27 AM
11-07-2014 12:27 AM
Re: 11iv3 PATH not getting setup from /etc/profile
What shell you are using?
If you set PATH in your own profile, don't forget to include $PATH too.
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2014 12:33 AM
11-07-2014 12:33 AM
Re: 11iv3 PATH not getting setup from /etc/profile
Hi Team ,
Please find .profile of 1 user below ;
root #/etc >su - tejachau
$ cat .profile
# @(#)B.11.31_LR
# Default user .profile file (/usr/bin/sh initialization).
# Set up the terminal:
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff
tabs
# NOTE: '.' is added to $PATH for compatibility reasons only. This
# default will be changed in a future release. If "." is not
# needed for compatibility it is better to omit this line.
# Please edit .profile according to your site requirements.
# Set up the search paths:
PATH=$PATH:.
# Set up the shell environment:
set -u
trap "echo 'logout'" 0
# Set up the shell variables:
EDITOR=vi
export EDITOR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2014 03:00 AM
11-07-2014 03:00 AM
Re: 11iv3 PATH not getting setup from /etc/profile
question remains: what shell is in use? bash by chance?
Try
# sh
# echo $PATH
Any difference?
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2014 03:26 AM
11-07-2014 03:26 AM
Re: 11iv3 PATH not getting setup from /etc/profile
$ sh
$ echo $SHELL
/sbin/sh
$ echo $PATH
/usr/bin:.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2014 07:53 AM
11-07-2014 07:53 AM
Re: 11iv3 PATH not getting setup from /etc/profile
Could you please check what is the default shell for this user?
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2014 07:59 PM
11-07-2014 07:59 PM
Re: 11.31 PATH not getting setup from /etc/PATH
This only works if /etc/profile and ~/.profile work together and haven't been modified too much. :-)
My old ~/.profile actually reads /etc/PATH.
It should also work for the scummy C shell through csh.login.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2014 09:30 AM - edited 11-08-2014 09:40 AM
11-08-2014 09:30 AM - edited 11-08-2014 09:40 AM
Re: 11iv3 PATH not getting setup from /etc/profile
The 'standard' way to set the PATH variable is in /etc/profile, followed by possible additions or changes in your login profile (.profile). Are you really using /usr/bin/sh? It would be more useful to type ps -f (not ps -ef) to see your currently running shell. If you login with sh and then run ksh or some other shell, the PATH variable may be getting reset.
All the PATH setting in /etc/profile and .profile can be destroyed with one command like this:
PATH=/usr/bin
which has occured somewhere before your .profile starts, which states:
PATH=$PATH:.
Most likely, /etc/profile has an added line at the bottom that looks like this:
PATH=/usr/bin
Start by locating all the PATH words in your /etc/profile:
grep PATH /etc/profile
If you see something like this:
PATH=$(cat /etc/PATH)
Then the complete value for /etc/PATH is being set there.
But if you see another PATH=something that does NOT incude $PATH, then the old value is being completely replaced.
NOTE: There may be a 'sourced' script in /etc/profile that is doing this. Look for a line that starts with a period like this:
. /someplace/somescript
That may be the culprit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2014 12:03 PM - edited 11-08-2014 12:08 PM
11-08-2014 12:03 PM - edited 11-08-2014 12:08 PM
Re: 11.31 PATH not getting setup from /etc/profile
>If you see something like this: PATH=$(cat /etc/PATH)
Or more efficiently without that evil cat: PATH=$(< /etc/PATH)
But the ones I see use the deprecated ``: PATH=`cat /etc/PATH`
- Tags:
- evil cat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2014 01:27 AM - edited 11-10-2014 02:03 AM
11-10-2014 01:27 AM - edited 11-10-2014 02:03 AM
Re: 11.31 PATH not getting setup from /etc/profile
root #/ >grep "PATH" /etc/profile
# Modify the variables through /etc/PATH and /etc/MANPATH
PATH=/usr/local/bin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin
MANPATH=/usr/share/man:/usr/contrib/man:/usr/local/man
# Insure PATH contains either /usr/bin or /sbin (if /usr/bin is not available).
PATH=$PATH:/sbin
else if [ -r /etc/PATH ]
# Insure that $PATH includes /usr/bin . If /usr/bin is
# present in /etc/PATH then $PATH is set to the contents
# of /etc/PATH. Otherwise, add the contents of /etc/PATH
# to the end of the default $PATH definition above.
-e ":/usr/bin$" /etc/PATH
PATH=`cat /etc/PATH`
PATH=$PATH:`cat /etc/PATH`
export PATH
# Set MANPATH to the contents of /etc/MANPATH, if it exists.
if [ -r /etc/MANPATH ]
MANPATH=`cat /etc/MANPATH`
export MANPATH
Hi Guys can i replace /etc/profile online ?
could be a corrupt one ?
One of my junior was trying to install mysql i this host , that also needs to be checked since it has a depot file which uses /etc/profile for its installation .