How to add path to root user


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to add path to root user
# 8  
Old 10-16-2012
Can you post the entire .bash_profile file you just created?
# 9  
Old 10-16-2012
How to add path to root user

this is the script i added for .bash_profile

Code:
# .bash_profile 
# Get the aliases and functions 
if [ -f ~/.bashrc ]; then 
. ~/.bashrc 
fi 
# User specific environment and startup programs 
PATH=$PATH:/usr/sbin:/bin:/usr/bin:/sbin:/opt/ubersvn/ubersvn/bin:. 
BASH_ENV=$HOME/.bashrc 
USERNAME="root" 
export USERNAME BASH_ENV PATH

# 10  
Old 10-16-2012
Looks good to me. But in a previous post you wrote (notice the red colon)
Code:
/usr/sbin:/bin:/usr/bin:/sbin:/opt/ubersvn:ubersvn/bin:.

Is there someting in .bashrc that resets PATH to something different?
# 11  
Old 10-16-2012
How to add path to root user

sorry, i only posted worngly.
the correct one is
/usr/sbin:/bin:/usr/bin:/sbin:/opt/ubersvn/ubersvn/bin:.in .bashrc code also i didn't see any path declaration.
but in /etc/profile file i am seeing that $UID=0 then they adding following path.
/usr/sbin:/bin:/usr/bin:/sbini tried there also to add /opt/ubersvn/ubersvn/bin
but its not working
# 12  
Old 10-16-2012
Hmm, strange. Are you sure, you are using bash? What does
Code:
ps -f -p $$

print?
# 13  
Old 10-16-2012
How to add path to root user

yes working in bash only
see below:
Code:
UID        PID  PPID  C STIME TTY          TIME CMD
root     32591 32590  0 16:50 pts/1    00:00:00 bash

# 14  
Old 10-16-2012
Then I'm afraid, I am out of ideas for the moment. Anyone else?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to give root access to non root user?

Currently in my system Red Hat is installed. And Many user connect to my machine via SSH Techia Terminal. I want to give some users a root level access. Can anyone please help me how to make it possible. I too searched on the Google but didn't find the correct way Regards ADI (4 Replies)
Discussion started by: adisky123
4 Replies

2. UNIX for Advanced & Expert Users

Root and non-root user not able to delete the file

Hi!! one strange problem occurred with my RHEL 5 box. i'm having logs folder with ownership of non-root user. Created some files with root user under logs folder. here is the scene: -rw-r----- 1 root root 1048227 Feb 28 12:34 SystemOut_13.02.28_12.34.10.log -rw-r----- 1 root root ... (6 Replies)
Discussion started by: sukhdip
6 Replies

3. UNIX for Dummies Questions & Answers

Sudo to delegate permission from non-root user to another non-root user

I've been through many threads before i decide to create a separate thread. I can't really find the solution to my (simple) problem. Here's what I'm trying to achieve: As "canar" user I want to run a command, let's say "/opt/ocaml/bin/ocaml" as "duck" user. The only to achieve this is to... (1 Reply)
Discussion started by: canar
1 Replies

4. Solaris

add PATH as root

Sorry this maybe a dumb one, but I am root and want to add something to my PATH. Is the right place to do it here: /usr/dt/config/dtspcdenv ? If so, after I add it, how do I source it? Neither "source <file>" nor ". <file>" work. How does the above file work... is there another... (5 Replies)
Discussion started by: steve701
5 Replies

5. Solaris

cannot add PATH to user crontab file

hi All, here is the problem: I'm not able to specify a PATH inside the user crontab file (/var/spool/cron/crontabs). The only syntax it accepts is the usual "* * * * * file" I'm not able to add PATH, or HOME, or MAILTO, or anything else. when I try to save the crontab, I have the error: ... (1 Reply)
Discussion started by: joe_x
1 Replies

6. Shell Programming and Scripting

Appending a path in user's PATH variable

Hello Folks, I want to append a path in user's PATH variable which should be available in current session. Background Numerous persons will run a utility. Aim is to add the absolute path of the utility the first time it runs so that next runs have the PATH in env & users can directly run... (6 Replies)
Discussion started by: vibhor_agarwali
6 Replies

7. UNIX for Dummies Questions & Answers

How to allow access to some commands having root privleges to be run bu non root user

hi i am new to unix and i have abig task. i have to \run particular commands having root privileges from a non root user. i know sudo is one of the way but i need sum other approach kindly help Thanks (5 Replies)
Discussion started by: suryashikha
5 Replies

8. Shell Programming and Scripting

root user command in shell script execute as normal user

Hi All I have written one shell script for GPRS route add is given below named GPRSRouteSet.sh URL="www.google.com" VBURL="10.5.2.211" echo "Setting route for $URL for GPRS" URL_Address=`nslookup $URL|grep Address:|grep -v "#"|awk -F " " '{print $2}'|head -1` echo "Executing ... (3 Replies)
Discussion started by: mnmonu
3 Replies

9. Shell Programming and Scripting

Executing Commands From Non-Standard Path (Changing user's PATH secretely???)

Hi: I have a requirement as below: I have some standard Unix commands modified and kept them in a directory say /usr/clsh/bin. For example I have a script named "ls" kept here which is modified version of "ls" (say it always gives long listing i.e. ls -l). When any user logs on and types... (2 Replies)
Discussion started by: ramesh_samane
2 Replies

10. UNIX for Dummies Questions & Answers

mistyped shell path, now i can't login as the only user that can su to root

i mistyped the location of bash and now i can't login as the only other user who belongs to wheel on my freebsd box. since i'm having many problems with samba, this has frozen my attempts to get things resolved with the former issue. i've been told that 'su -m' should do the trick, but it's... (3 Replies)
Discussion started by: xyyz
3 Replies
Login or Register to Ask a Question