moving bash

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

chucker8

Thread Starter
Joined
Jun 11, 2004
Messages
60
Hi All,
This applies to Solaris 2.6.

I need to move the bash program from /usr/local/bin to /bin.

Is it as simple as just moving the file from one directory to the other? ie

# pwd
/usr/local/bin
#mv bash /bin
#

thanks!
 
Joined
Mar 6, 2003
Messages
432
Why do you need to move bash? Doing this will likely have many unintended consequences. It might be easier/wiser to add /usr/local/bin to the PATH environment variable rather than moving the file. Or at the least create a symbolic link rather than move.

Create a link from /usr/local/bin/bash to /bin/bash with:
ln -s /usrl/local/bin/bash /bin/bash

Added /usr/local/bin to your PATH with:
export PATH=$PATH:/usr/local/bin

The above keeps the current path with the appended /usr/local/bin.
 

chucker8

Thread Starter
Joined
Jun 11, 2004
Messages
60
thanks for reply!
I had the OS rebuilt. I have many bash scripts which call bash from /bin. If I create the link will I be good to go?

thx
 

Squashman

Retired Trusted Advisor
Joined
Apr 4, 2003
Messages
19,786
I had this happen to me as well once but it was because I moved my website from one provider to another. It had Perl in a different directory so I had to change a lot of perl scripts. I didn't do it manually. Search google for Perl One Liners. It will help you change your path to all your bash scripts very quickly.
 
Joined
Jun 15, 2005
Messages
431
It's almost never a good idea to use absolute path names in scripts. As linuxphile suggests, use your PATH variable to your advantage, and, in this case, make a link to bash in /bin.
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Members online

Top