Find the answer to your Linux question:
Results 1 to 9 of 9
Hi, Can anyone help me understand the following behavior (distribution details below)? Looking at my PATH variable I find the directory /latham/bin Then I create a new executable in this ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2004
    Location
    Nashua, NH
    Posts
    4

    new executable in PATH not immediately found


    Hi,

    Can anyone help me understand the following behavior (distribution details below)?

    Looking at my PATH variable I find the directory /latham/bin

    Then I create a new executable in this directory:

    $ cp calcmort ~/latham/bin/.

    When I try to execute it or locate it I get:

    $ calcmort
    calcmort: Command not found
    $ which calcmort
    calcmort: Command not found

    However, if I login into the same machine and execute it, it succeeds.

    $ rlogin mypc
    ...
    $ calcmort
    Success!

    Does Linux cache the contents of the directories specified in PATH? Is there anyway to get it to update the contents?

    Red Hat 7.3 Linux Kernel 2.4.21-1

    Thanks.
    Barry

  2. #2
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    How did you add that dir to you $PATH? If you didn't export it, you will need to log out and then back in for BASH to re-read $PATH.
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  3. #3
    Just Joined!
    Join Date
    Jul 2004
    Location
    Nashua, NH
    Posts
    4
    The directory had been part of my PATH for a long time (I didn't just add it). Its in my .login file.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    Try putting the export command in your ~/.bashrc.
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  6. #5
    Just Joined!
    Join Date
    Jul 2004
    Location
    Nashua, NH
    Posts
    4
    I moved the set path from my .login to my .cshrc and it didn't make a difference. Same behavior.

  7. #6
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    Can you post the line? Maybe there's a typo somewhere or something...

    /me is reaching now.
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  8. #7
    Linux Newbie
    Join Date
    May 2004
    Location
    Chennai, India
    Posts
    116
    Quote Originally Posted by BarryLatham
    I moved the set path from my .login to my .cshrc and it didn't make a difference. Same behavior.
    changes to environment variables in .bash_profile / .cshrc / .login files generally needs you to re-login to get reflected in your shells.

    alternatively you can

    Code:
    $ source file
    NOTE: file is your .cshrc / .bash_profile / ....

    by doing this you can have the new changes reflected in the CURRENT shell and its Sub shells ONLY.

    regards,
    Sunny.
    NEVER stop/pause Journey of Learning -Travelling Soldier ( Me )

  9. #8
    Just Joined!
    Join Date
    Jul 2004
    Location
    Nashua, NH
    Posts
    4
    Ahh, but there were no changes in my .login/.cshrc.
    That PATH directory has been there for years. The only change was
    adding a new binary to the directory it points to. If the shell is indeed
    searching the PATH each time for a command, it should have found the
    new binary. But it didn't.

  10. #9
    Just Joined!
    Join Date
    Oct 2003
    Location
    The Netherlands
    Posts
    89
    i've got the same problem, when i copy an executable to lets say /usr/sbin/ , it doesn't work until another login, however when i type in the complete path: /usr/sbin/ndiswrapper for instance, it works...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •