07-09-2013 02:09 PM - last edited on 07-09-2013 10:30 PM by Maiko-I
I am truing to add some directories to the productive HP-UX (like /usr/sbin)
the problem is that i tried some methods like (export) and setenv but i failed.
I add some logs output of the commands to provide you with more info .
the user which I am trying to add this path is different with the root user.
for root user the output of the (echo $PATH is only two directories and is different with the user in use for the services.
Logs are as following:
the /ust/sbin must be added to the above path not to replace it!
# Default (example of) system-wide profile file (/usr/bin/sh initialization).
# This should be kept to the bare minimum every user needs.
# Ignore HUP, INT, QUIT now.
trap "" 1 2 3
# Set the default paths - Do NOT modify these.
# Modify the variables through /etc/PATH and /etc/MANPATH
# Insure PATH contains either /usr/bin or /sbin (if /usr/bin is not available).
if [ ! -d /usr/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.
grep -q -e "^/usr/bin$" -e "^/usr/bin:" -e ":/usr/bin:"\
-e ":/usr/bin$" /etc/PATH
if [ $? -eq 0 ]
# Set MANPATH to the contents of /etc/MANPATH, if it exists.
if [ -r /etc/MANPATH ]
# Set the TIMEZONE
if [ -r /etc/TIMEZONE ]
TZ=MST7MDT # change this for local time.
# Be sure that VUE does not invoke tty commands
if [ ! "$VUE" ]; then
# set term if it's not set
if [ "$TERM" = "" -o "$TERM" = "unknown" -o "$TERM" = "dialup" \
-o "$TERM" = "network" ]
eval `ttytype -s -a`
# set erase to ^H, if ERASE is not set
if [ "$ERASE" = "" ]
stty erase $ERASE
# Set up shell environment:
trap "echo logout" 0
# This is to meet legal requirements...
# Message of the day
if [ -r /etc/motd ]
# Notify if there is mail
if [ -f /usr/bin/mail ]
if mail -e
then echo "You have mail."
# Notify if there is news
if [ -f /usr/bin/news ]
then news -n
# Change the backup tape
if [ -r /tmp/changetape ]
then echo "\007\nYou are the first to log in since backup:"
echo "Please change the backup tape.\n"
rm -f /tmp/changetape
fi # if !VUE
# Leave defaults in user environment.
trap 1 2 3
for the root user:
P.S. this thread has been moved from HP-UX > System Administration to HP-UX > languages. - HP Forum Moderator
07-09-2013 10:37 PM - edited 07-09-2013 10:38 PM
>I am trying to add some directories to the production HP-UX (like /usr/sbin)
First of all no sysadmin should be caught dead using the scummy C shell!
And ordinary csh users wouldn't need /usr/sbin in their paths. And if they do, they already know how to do that.
I.e. you shouldn't enable their choice of a broken shell. ;-)
>setenv but I failed.
setenv is the right command for csh. But it needs to be in /etc/csh.login not /etc/profile.