1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

moving bash

Discussion in 'Linux and Unix' started by chucker8, Jan 5, 2006.

Thread Status:
Not open for further replies.
Advertisement
  1. chucker8

    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!
     
  2. linuxphile

    linuxphile Administrator

    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.
     
  3. chucker8

    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
     
  4. linuxphile

    linuxphile Administrator

    Joined:
    Mar 6, 2003
    Messages:
    432
    Yes I believe you will.

    Good luck!
     
  5. Squashman

    Squashman 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.
     
  6. AGCurry

    AGCurry

    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.
     
  7. Sponsor

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 733,556 other people just like you!

Loading...
Similar Threads - moving bash
  1. Damonc
    Replies:
    2
    Views:
    172
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/431407

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice