Adding Directories to PATH in HP-UX with csh

HI Guys,
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:

#echo $PATH
/opt/local/bin:/opt/NSCPnav/bin:/oracle/db/product/11.1.0/db_1/bin:/enip/enipapp/cbp/add-ons/bin:
/enip/enipapp/cbp/bin:/enip/enipapp/cbp/service/sys/servicerun/bin:/enip/enipapp/cbp/service/app/servicerun/bin:.:
/opt/informix/informix_server/bin:/enip/enipapp/cbp/tools:/enip/enipapp/cbp/tools/bin:/enip/enipapp/cbp/ext/cbe/tools:
/enip/enipapp/cbp/bin:/opt/freeware/bin:/usr/vacpp/bin:/usr/bin:/usr/ccs/bin:/usr/contrib/bin:/usr/contrib/Q4/bin:/opt/perl/bin:
/opt/ipf/bin:/opt/gvsd/bin:/opt/nettladm/bin:/opt/fcms/bin:/opt/wbem/bin:/opt/wbem/sbin:/opt/sas/bin:/opt/graphics/common/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/gnome/bin:/opt/ignite/bin:/opt/propplus/bin:/usr/contrib/kwdb/bin:/opt/mozilla:
/opt/perl_32/bin:/opt/perl_64/bin:/opt/prm/bin:/opt/sfm/bin:/opt/swm/bin:/opt/sec_mgmt/spc/bin:/opt/ssh/bin:/opt/sentinel/bin:
/opt/swa/bin:/opt/hpsmh/bin:/opt/thunderbird:/opt/langtools/bin:/opt/gwlm/bin:/opt/cfg2html:.:/opt/aCC/bin

the Profile:

cat /etc/profile

# @(#)B.11.31_LR     

# 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 

        PATH=/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).

        if [ ! -d /usr/sbin ]
        then
                PATH=$PATH:/sbin

        else    if [ -r /etc/PATH ]
                then

                # 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 ]
                        then
                                PATH=`cat /etc/PATH`
                        else
                                PATH=$PATH:`cat /etc/PATH`
                        fi
                fi
        fi

        export PATH

# Set MANPATH to the contents of /etc/MANPATH, if it exists.

        if [ -r /etc/MANPATH ]
        then
                MANPATH=`cat /etc/MANPATH`
        fi

        export MANPATH

# Set the TIMEZONE      

        if [ -r /etc/TIMEZONE ]
        then
           . /etc/TIMEZONE      
        else
            TZ=MST7MDT               # change this for local time.  
            export TZ
        fi

# 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" ]
        then
                eval `ttytype -s -a`
        fi

        export TERM

   # set erase to ^H, if ERASE is not set
        if [ "$ERASE" = "" ]
        then
                ERASE="^H"
                export ERASE
        fi
        stty erase $ERASE

   # Set up shell environment:

        trap "echo logout" 0


   # This is to meet legal requirements...

        cat /etc/copyright

   # Message of the day

        if [ -r /etc/motd ]
        then
                cat /etc/motd
        fi

   # Notify if there is mail

        if [ -f /usr/bin/mail ]
        then
                if mail -e
                then    echo "You have mail."
                fi
        fi

   # Notify if there is news

        if [ -f /usr/bin/news ]
        then news -n
        fi

   # 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

   fi                                           # if !VUE

# Leave defaults in user environment.

   trap 1 2 3                   

for the root user:

echo $PATH
/usr/bin:/usr/sbin:/sbin

if you are using csh , set the PATH variable in $HOME/.cshrc or $HOME/.login ...

when you login as root either through su - or directly on the console, you will get the environment set by $HOME/.profile and/or /etc/profile because root's default shell is sh ...

however -- when you change your shell to csh -- the environment set is based on the default PATH (see man csh ) if $HOME/.cshrc or $HOME/.login does not exist ...

setting csh path

You should know that on HP-UX root uses by default /sbin/sh ( till 11.11 anyway...) and when you su to root you have a minimalist PATH set as you have noticed, this was for security reasons ( beeing root means also you know where things are and you can rest PATH if you wish...) this was a way to not people external to the IT team do any damage to the box ( e.g. when someone comes to install some software and asks for root access... )

What you are asking is something trivial for any HP sysadm, but I know none that would use csh... If you read the /etc/profile you would have guessed..

csh uses the path shell variable.

echo $path
set path = (/usr/barry1946 $path)

The character between each directory in the C shell's $path variable is a space.

csh, by default, uses the path shell variable to search for executables and scripts.

echo $path
set path = (/usr/barry1946 $path)

The character between each directory in the C shell's $path variable is a space.

csh has a magic link between its path variable and PATH.
The csh fans tell to use path because they think its list format is easier.
But you can use/modify PATH instead (with setenv); with proper "quotes" it is even safer.