Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: The No such file or directory warning is correct?

  1. #1

    Default The No such file or directory warning is correct?

    Hi,
    When I learn shell script, I want to add my own PATH variable to system previous variables. I find that my linux has the below PATH variables (in the end of this message). It shows 'No such file or directory' although I verify that all the directories exist. Some directories are empty indeed. This will result that warning?

    I want to make the present PATH variables correct before I add mine. Thanks






    ....
    bash: /usr/lib/mpi/gcc/openmpi/bin:/home/jeff/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/jvm/jre/bin: No such file or directory

  2. #2
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Default Re: The No such file or directory warning is correct?

    To add your own path to you as a single user, you can add this to the file ~/.bashrc:

    To edit this file in KDE do a menu Run Command (or just press Alt-F2):


    kwrite ~/.bashrc


    Then add a line like the following with your new path command where /folder/mypath is changed to the path you want to add:


    PATH=/folder/mypath:$PATH


    Then save the file, log out and back in to see your path added for you.


    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  3. #3
    Join Date
    Nov 2010
    Location
    Youngstown, OH
    Posts
    155

    Default Re: The No such file or directory warning is correct?

    vi + .bashrc and add
    Code:
     export PATH=$PATH:/path/to/new/directory
    Save and Exit .bashrc
    type
    Code:
    source ~/.bashrc
    then
    Code:
    echo $PATH
    You can short-term test it by just typing
    Code:
    export PATH=$PATH:/path/to/new/directory
    in a terminal window, then the binary should run if done correctly.
    Once that's verified, then add it to .bashrc for permanence.
    Lenovo: OpenSUSE 11.4/32 | Xfce 4.8.1 | Intel Core2 Duo T7200 | Intel 945GM/GMS | 4G RAM | Firefox 8.0 | Thunderbird 3.1.16

  4. #4
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,140
    Blog Entries
    48

    Smile Re: The No such file or directory warning is correct?

    Thanks Habitual for the catch on needing to use the export command:

    Code:
    export PATH=$PATH:/path/to/new/directory
    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,158

    Default Re: The No such file or directory warning is correct?

    As PATH is allready exported to the environment, there is not need to export it again (and again) when the value is changed. It does no harm of course, but it is one of those urban legends spread through the Linux world without increasing the real knowledge about what export is and does.

    And to the OP. Your "last line" is a bit strange. When you want to post any computer output, please copy/paste that text please between CODE tags (Posting in Code Tags - A Guide) and please as complete as possible, thus we all can see what commands you used and what the results were. E.g., I would show the PATH variable as it was at a certain moment in this way:
    Code:
    henk@boven:~> export $PATH
    bash: export: '/home/henk/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin:/home/henk/.local/bin': is geen geldige naam
    henk@boven:~>
    To my surprise, I have the same silly argument there!!!!!!
    This must be due to a bug somewhere in my .profile or .bashrc. I am going to investigate!

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,158

    Default Re: The No such file or directory warning is correct?

    Oh, oh, oh! I am realy silly.
    I should have published:
    Code:
    henk@boven:~> echo $PATH
    /home/henk/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/mit/bin:/usr/lib/mit/sbin:/home/henk/.local/bin
    henk@boven:~>
    Now everybody can see how important it is not only to show what the system says, but also what one asked the system!

    After I have shown how stupid I can be, maybe @freerjw you can tell us how you got that error message.
    Henk van Velden

  7. #7
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: The No such file or directory warning is correct?

    On 05/13/2011 02:36 AM, freerjw wrote:

    >I find that my linux has the below PATH variables
    > (in the end of this message). It shows 'No such file or directory'
    > although I verify that all the directories exist. Some directories are
    > empty indeed. This will result that warning?
    >
    > bash:
    > /usr/lib/mpi/gcc/openmpi/bin:/home/jeff/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/usr/lib/jvm/jre/bin:
    > No such file or directory


    remove the final : (behind bin) and that "No such file or directory"
    should go away.....i _think_ with that bin: it is now looking for a file
    or directory named " " (space) or "
    " (end of line)

    --
    dd CAVEAT: http://is.gd/bpoMD
    [NNTP via openSUSE 11.4 [2.6.37.6-0.5] + KDE 4.6.0 + Thunderbird 3.1.10]
    Dual booting with Sluggish Loser7 on Acer Aspire One D255

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,158

    Default Re: The No such file or directory warning is correct?

    I think you missed something DD. We are still waiting for he OP to explain how he got that line with the error (it is not a warning imho).

    You assume that he displays the contents of his environment variable PATH. But as he does not show how he got that line, I doubt that this is his PATH at all.

    As you can see in my two posts, I am able to generate a line same as his by giving a command that DOES NOT display the PATH (in this case export $PATH, but I guess there are more possibilities). When I do echo $PATH the PATH is displayed and does not contain an error message.

    That is the reason why I allways encourage to post not only the generated output of a command, but also the command itself. To avoid people assuming that the correct command was given where it was not.
    Henk van Velden

  9. #9
    Join Date
    Jun 2008
    Location
    Earth - Denmark
    Posts
    10,730

    Default Re: The No such file or directory warning is correct?

    On 05/16/2011 07:36 PM, hcvv wrote:
    >
    > I think you missed something DD. We are still waiting for he OP to
    > explain how he got that line with the error (it is not a warning imho).


    you are, as usual correct..

    and the short answer to the OP is (i guess):

    if you use the correct way to see your path, the "No such file..." error
    _may_ go away..

    try this (the correct) way to see your path: echo $PATH

    --
    dd CAVEAT: http://is.gd/bpoMD
    [NNTP via openSUSE 11.4 [2.6.37.6-0.5] + KDE 4.6.0 + Thunderbird 3.1.10]
    Dual booting with Sluggish Loser7 on Acer Aspire One D255

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,158

    Default Re: The No such file or directory warning is correct?

    Because the OP never bothered to post here again after he started this thread four days ago, I guess we can stop our efforts to try to help him
    Henk van Velden

Page 1 of 2 12 LastLast

Posting Permissions

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