Find the answer to your Linux question:
Results 1 to 4 of 4
hello all, I was wondering if there is a way to change the exec path for some application application (besides doing the ln -s ? ex. $ vim -bash: /usr/local/bin/vim: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2008
    Posts
    4

    Unhappy execution path


    hello all,

    I was wondering if there is a way to change the exec path for some application application (besides doing the ln -s ?

    ex.
    $ vim
    -bash: /usr/local/bin/vim: No such file or directory

    $ which vim
    /usr/bin/vim

    how do i permanently change that path from usr/local/bin/vim to /usr/bin/vim ???

    thanks !

  2. #2
    Linux Newbie danielsmw's Avatar
    Join Date
    Nov 2006
    Location
    Clemson, SC / Charleston, SC
    Posts
    110
    That's odd... that output makes no sense to me. If
    Code:
    which vim
    finds /usr/bin/vim, it should automatically execute that file when you call it. The only way it would even know that vim is in /usr/bin/vim is if /usr/bin is in your $PATH variable.

    Could you run
    Code:
    echo $PATH
    and post the output here?
    Registered Linux User: #479567
    Asking a question? Read this page first.
    Now... sudo make me a sandwich.
    ratiocinativeroot.blogspot.com

  3. #3
    Just Joined!
    Join Date
    Oct 2008
    Posts
    4
    Code:
    echo $PATH
    /usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/pavel/bin

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie danielsmw's Avatar
    Join Date
    Nov 2006
    Location
    Clemson, SC / Charleston, SC
    Posts
    110
    Hmm... one possible issue that you have something in /usr/local/bin that bash wants to use as vim but then throws an error about it not being there. Out of curiosity, let's rearrange the directories in your PATH. Run this command:
    Code:
    export PATH=/usr/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/home/pavel/bin
    And then try executing vim again. All that command does, btw, is rearrange the order of some variables; it shouldn't have any obvious affects (except, hopefully, vim will work).
    Note that the export command will only set the PATH variable to that new value in that particular instance of bash. When you close the terminal, or switch to a different one, PATH will revert to its old value. This is just some testing for now
    Registered Linux User: #479567
    Asking a question? Read this page first.
    Now... sudo make me a sandwich.
    ratiocinativeroot.blogspot.com

Posting Permissions

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