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.
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:
Code:
echo $PATH
/usr/bin:/usr/sbin:/sbin
Last edited by Scott; 07-09-2013 at 07:17 PM..
Reason: Please use code tags
Hello
i use bash and i added a path variable for 2 files /rscr and /uscr in /etc/profile
/rscr working fine but the other one shows command not found
and when i try to type whereis for scripts in /rscr it shows them but the other one shows nothing... thanks :b: (3 Replies)
Hello All,
I am somehow stumped with this ting.
'Find' will sure show me.. but I want only thepath of all the occurences of the file in any of the sub-dirs..
Any help will be sincerely appreciated.
thanx! (3 Replies)
Hi,
Iam new to UNIX...My requirement is to create 3 dir as an hierarchy under /var/opt/temip.The output should be /var/opt/temip/GP_Int/GPTTS/AUTO.
I have tried the following script...But only GP_int folder is getting created and not other folders...Can someone help???
#!/usr/bin/ksh
#script... (1 Reply)
Hi All,
My UNIX Version is:
OS Name Release Version
AIX appma538 3 5
I want to find certain files with some criterias under the given path. At the same time i want to find the files which resides under the given directory, but normal find traverse to its sub-directories... (4 Replies)
Hi.
im learning unix, and i have problem with my shell . i want to add hierarchical directories. so theshell have mkdir, rmdir and chdir commands.
the coding in C language.
i looked at the source of mkdir for example, and its very long and complicated. i need simple implementation... (9 Replies)
Hi,
I want to get ABC and 924 from this path. How can i do so?
The length of the path can vary from but end will we same.
/home/abs/cad/bad_BAD/vdhingra/testcases/ABC/924/work
Similarly, CBA and 234 from this path.
/home/abs/cad/aaa/bad_BAD/vdhingra/testcases/CBA/234/work (5 Replies)
Hi,
I want to grep a word say "fan" from a file and redirect those lines in a file with "#" before them.
eg
all
fan is on
i am you
you are me
i am on fan
Expected o/p
#fan is on
#i am on fan (2 Replies)
Can anyone come up with a unix command that lists
all the files, directories and sub-directories in the current directory
except a folder called log.?
Thank you in advance. (7 Replies)
Hi guys :)
First of all Happy New Year :)
so i dont know if my doubt its already here posted by other person ...
i need to print to one file the path of few files that are in different directories, like this:
directory muscle
ATP6.aa.muscle.fasta
COX1.aa.muscle.fasta
.
.
.
... (2 Replies)
Hi there,
I have the following in my path:
export PATH=/usr/bin:/usr/sbin
But I want to change it programmatically(for the purpose of JBoss automatic(ansible) installs) to:
export PATH=/usr/bin:/usr/sbin:/usr/jdk/jdk1.8.0_60
and after that I need to insert the JAVA_HOME programmatically,... (7 Replies)