Permanent changes to PATH


 
Thread Tools Search this Thread
Operating Systems Solaris Permanent changes to PATH
# 1  
Old 03-17-2008
Permanent changes to PATH

Hi guys,

I'm running Solars 8 on a V100 server at home for testing.
If I switch user to root and do:

# echo $PATH

This is the output:

/usr/sbin:/usr/bin

I'm using rsync over ssh and need to add /usr/local/bin and /user/local/sbin.

I do this by running the line:

# PATH=/usr/sbin:/usr/bin:/usr/local/bin:/user/local/sbin

And it runs fine until reboot. Can someone please tell me how to make this change permanet?

Thanks in anticipation.

Stin
# 2  
Old 03-17-2008
add the following like to your .profile. This should do it for you.

export PATH=/usr/sbin:/usr/bin:/usr/local/bin:/user/local/sbin

keep in mind that if you write cron jobs, the .profile is not run when the cron job fires, so you will either have to hard code your paths or source in the .profile to each shell script you put in there.
# 3  
Old 03-17-2008
Exporting PATH won't work. When you switch to root using the su command, your PATH is reset to a default value which is /bin:/sbin.
You can modify this default value by changing SUPATH the /etc/default/su file.
# 4  
Old 03-18-2008
Thanks guys! All sorted now.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Command to see the logical volume path, device mapper path and its corresponding dm device path

Currently I am using this laborious command lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}' Would like to know if there is any shorter method to get this mapping of... (2 Replies)
Discussion started by: royalibrahim
2 Replies

2. Solaris

how to make IP address permanent.

Greetings, I am using solaris10 x86 OS. I configured IP address using the command. >ifconfig e1000g0 plumb >ifconfig e1000g0 200.200.0.1 up How to make this configured IP as permanent.. to solaris os. (2 Replies)
Discussion started by: bhargav90
2 Replies

3. UNIX for Advanced & Expert Users

rm non-permanent delete

I read this article as a way to do a non-permanent of something. I saw 2 problems. The first that my rm is located at /bin/rm. I would assume I would change the location to /bin/rm. The second my rm is a executable file and not a text file. So will replacing my rm file with the shellscript... (3 Replies)
Discussion started by: cokedude
3 Replies

4. HP-UX

set permanent ulimit

Hi all I have a request from user to change the file descriptors limit to 8192. The current setting are: root@xxxxx:(wmdev)> ulimit -a time(seconds) unlimited file(blocks) unlimited data(kbytes) 1048576 stack(kbytes) 131072 memory(kbytes) unlimited... (3 Replies)
Discussion started by: hedkandi
3 Replies

5. Solaris

Solaris 9 -- unable to set permanent PATH

Hi, I've read forums far and wide trying to learn how to append to my PATH in Solaris 9 and every time I think I am close I discover my system is not configured the same. Its so frustrating because this all stems from a new server I am trying to setup identical to the production machine. (Of... (5 Replies)
Discussion started by: thoraddict
5 Replies

6. UNIX for Dummies Questions & Answers

Making an alias permanent

Hi mates, I want to make an alias permanent for a KShell, does someone knows how to do that? Thanks! (4 Replies)
Discussion started by: agasamapetilon
4 Replies

7. UNIX for Dummies Questions & Answers

Permanent Alias

On AIX 5.2 as root, installed Seamonkey and have to type #/seakey/seamonkey/seamonkey to get it to run, which it does okay. To set up a permanent alias, I did the following (1) In a text editor alias seamk='/seakey/seamonkey/seamonkey' and saved it to /home/alias_file (2) In a text editor... (7 Replies)
Discussion started by: farl
7 Replies

8. Solaris

permanent route

How do I make a route permanent, other than default route on a Solaris server? (1 Reply)
Discussion started by: jontom
1 Replies

9. AIX

Permanent Default Route

Hi, We are running AIX 5.2. Our default gateway used to be IP Address A. Our new default gateway is IP Address B. A netstat revealed that our default route was IP address A. We manually added default route with IP address B and removed the default route with IP address A. However,... (3 Replies)
Discussion started by: DenD
3 Replies

10. IP Networking

Permanent ip routing

I am trying to add a permanent route on my server, but whenever i reboot it dissapears. Please does anyone know the correct command to use. route add XXX.XXX.XXX.XXX DDD.DDD.DDD.DDD the above is what i have done. ednut:) using IRIX SGI software. (2 Replies)
Discussion started by: Ednut
2 Replies
Login or Register to Ask a Question