binary placed in folder on $PATH is not immediately accessible

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












in my $PATH I have folder ~/.zsh/bin which I use for small scripts and custom built executable binaries, for example I added a recently compiled tool I made called wercker_build_status to the folder. Yet when I type in the command line wercker_build_status it can't find it, I have to type the full path to the file, ~/.zsh/bin/wercker_build_status.



That's not to say nothing in the folder doesn't work, a script I have called wifi_status is in there and typing that into the command line returns the wifi status as expected.



Why is it even though it's in my $PATH I can't just use a file I add to the folder ~/.zsh/bin?







share|improve this question






















  • I suppose it works if you open a new terminal window (or any way to spawn a new shell)?
    – Ulrich Schwarz
    Apr 3 at 9:08










  • What is your PATH? Is the tool executable? Is zsh OK with having tilde in PATH instead of $HOME?
    – Kusalananda
    Apr 3 at 9:09










  • @UlrichSchwarz it does not why does my $PATH matter when I explicitly stated that the folder is in the path? and yes it is executable and so far I've never had a problem with ZSH and having a tild in the PATH.
    – Thermatix
    Apr 3 at 9:25











  • OK, so it's probably not a caching issue. (IIRC, zsh will cache the names for tab completion, I'm not sure if it does the same for searching the path.)
    – Ulrich Schwarz
    Apr 3 at 10:18










  • M. Schwarz is thinking of unix.stackexchange.com/questions/408859 , unix.stackexchange.com/questions/82991 , and many others in the same vein.
    – JdeBP
    Apr 3 at 17:34














up vote
0
down vote

favorite












in my $PATH I have folder ~/.zsh/bin which I use for small scripts and custom built executable binaries, for example I added a recently compiled tool I made called wercker_build_status to the folder. Yet when I type in the command line wercker_build_status it can't find it, I have to type the full path to the file, ~/.zsh/bin/wercker_build_status.



That's not to say nothing in the folder doesn't work, a script I have called wifi_status is in there and typing that into the command line returns the wifi status as expected.



Why is it even though it's in my $PATH I can't just use a file I add to the folder ~/.zsh/bin?







share|improve this question






















  • I suppose it works if you open a new terminal window (or any way to spawn a new shell)?
    – Ulrich Schwarz
    Apr 3 at 9:08










  • What is your PATH? Is the tool executable? Is zsh OK with having tilde in PATH instead of $HOME?
    – Kusalananda
    Apr 3 at 9:09










  • @UlrichSchwarz it does not why does my $PATH matter when I explicitly stated that the folder is in the path? and yes it is executable and so far I've never had a problem with ZSH and having a tild in the PATH.
    – Thermatix
    Apr 3 at 9:25











  • OK, so it's probably not a caching issue. (IIRC, zsh will cache the names for tab completion, I'm not sure if it does the same for searching the path.)
    – Ulrich Schwarz
    Apr 3 at 10:18










  • M. Schwarz is thinking of unix.stackexchange.com/questions/408859 , unix.stackexchange.com/questions/82991 , and many others in the same vein.
    – JdeBP
    Apr 3 at 17:34












up vote
0
down vote

favorite









up vote
0
down vote

favorite











in my $PATH I have folder ~/.zsh/bin which I use for small scripts and custom built executable binaries, for example I added a recently compiled tool I made called wercker_build_status to the folder. Yet when I type in the command line wercker_build_status it can't find it, I have to type the full path to the file, ~/.zsh/bin/wercker_build_status.



That's not to say nothing in the folder doesn't work, a script I have called wifi_status is in there and typing that into the command line returns the wifi status as expected.



Why is it even though it's in my $PATH I can't just use a file I add to the folder ~/.zsh/bin?







share|improve this question














in my $PATH I have folder ~/.zsh/bin which I use for small scripts and custom built executable binaries, for example I added a recently compiled tool I made called wercker_build_status to the folder. Yet when I type in the command line wercker_build_status it can't find it, I have to type the full path to the file, ~/.zsh/bin/wercker_build_status.



That's not to say nothing in the folder doesn't work, a script I have called wifi_status is in there and typing that into the command line returns the wifi status as expected.



Why is it even though it's in my $PATH I can't just use a file I add to the folder ~/.zsh/bin?









share|improve this question













share|improve this question




share|improve this question








edited Apr 3 at 10:21









Jeff Schaller

31.1k846105




31.1k846105










asked Apr 3 at 9:06









Thermatix

19918




19918











  • I suppose it works if you open a new terminal window (or any way to spawn a new shell)?
    – Ulrich Schwarz
    Apr 3 at 9:08










  • What is your PATH? Is the tool executable? Is zsh OK with having tilde in PATH instead of $HOME?
    – Kusalananda
    Apr 3 at 9:09










  • @UlrichSchwarz it does not why does my $PATH matter when I explicitly stated that the folder is in the path? and yes it is executable and so far I've never had a problem with ZSH and having a tild in the PATH.
    – Thermatix
    Apr 3 at 9:25











  • OK, so it's probably not a caching issue. (IIRC, zsh will cache the names for tab completion, I'm not sure if it does the same for searching the path.)
    – Ulrich Schwarz
    Apr 3 at 10:18










  • M. Schwarz is thinking of unix.stackexchange.com/questions/408859 , unix.stackexchange.com/questions/82991 , and many others in the same vein.
    – JdeBP
    Apr 3 at 17:34
















  • I suppose it works if you open a new terminal window (or any way to spawn a new shell)?
    – Ulrich Schwarz
    Apr 3 at 9:08










  • What is your PATH? Is the tool executable? Is zsh OK with having tilde in PATH instead of $HOME?
    – Kusalananda
    Apr 3 at 9:09










  • @UlrichSchwarz it does not why does my $PATH matter when I explicitly stated that the folder is in the path? and yes it is executable and so far I've never had a problem with ZSH and having a tild in the PATH.
    – Thermatix
    Apr 3 at 9:25











  • OK, so it's probably not a caching issue. (IIRC, zsh will cache the names for tab completion, I'm not sure if it does the same for searching the path.)
    – Ulrich Schwarz
    Apr 3 at 10:18










  • M. Schwarz is thinking of unix.stackexchange.com/questions/408859 , unix.stackexchange.com/questions/82991 , and many others in the same vein.
    – JdeBP
    Apr 3 at 17:34















I suppose it works if you open a new terminal window (or any way to spawn a new shell)?
– Ulrich Schwarz
Apr 3 at 9:08




I suppose it works if you open a new terminal window (or any way to spawn a new shell)?
– Ulrich Schwarz
Apr 3 at 9:08












What is your PATH? Is the tool executable? Is zsh OK with having tilde in PATH instead of $HOME?
– Kusalananda
Apr 3 at 9:09




What is your PATH? Is the tool executable? Is zsh OK with having tilde in PATH instead of $HOME?
– Kusalananda
Apr 3 at 9:09












@UlrichSchwarz it does not why does my $PATH matter when I explicitly stated that the folder is in the path? and yes it is executable and so far I've never had a problem with ZSH and having a tild in the PATH.
– Thermatix
Apr 3 at 9:25





@UlrichSchwarz it does not why does my $PATH matter when I explicitly stated that the folder is in the path? and yes it is executable and so far I've never had a problem with ZSH and having a tild in the PATH.
– Thermatix
Apr 3 at 9:25













OK, so it's probably not a caching issue. (IIRC, zsh will cache the names for tab completion, I'm not sure if it does the same for searching the path.)
– Ulrich Schwarz
Apr 3 at 10:18




OK, so it's probably not a caching issue. (IIRC, zsh will cache the names for tab completion, I'm not sure if it does the same for searching the path.)
– Ulrich Schwarz
Apr 3 at 10:18












M. Schwarz is thinking of unix.stackexchange.com/questions/408859 , unix.stackexchange.com/questions/82991 , and many others in the same vein.
– JdeBP
Apr 3 at 17:34




M. Schwarz is thinking of unix.stackexchange.com/questions/408859 , unix.stackexchange.com/questions/82991 , and many others in the same vein.
– JdeBP
Apr 3 at 17:34










1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










Use $HOME in your path rather than tilde (~), especially if you enclose the new PATH in double quotes. The tilde is not expanded when it occurs in quotes.



Testing:



$ mkdir "$HOME/t"

$ cat >"$HOME/t/foo" <<END
#!/bin/sh
echo "hello"
END

$ chmod +x "$HOME/t/foo"

$ PATH="$PATH:~/t"

$ foo
zsh: command not found: foo

$ PATH="$PATH:$HOME/t"

$ foo
hello


See also: Why doesn't the tilde (~) expand inside double quotes?






share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );








     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f435230%2fbinary-placed-in-folder-on-path-is-not-immediately-accessible%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote



    accepted










    Use $HOME in your path rather than tilde (~), especially if you enclose the new PATH in double quotes. The tilde is not expanded when it occurs in quotes.



    Testing:



    $ mkdir "$HOME/t"

    $ cat >"$HOME/t/foo" <<END
    #!/bin/sh
    echo "hello"
    END

    $ chmod +x "$HOME/t/foo"

    $ PATH="$PATH:~/t"

    $ foo
    zsh: command not found: foo

    $ PATH="$PATH:$HOME/t"

    $ foo
    hello


    See also: Why doesn't the tilde (~) expand inside double quotes?






    share|improve this answer


























      up vote
      1
      down vote



      accepted










      Use $HOME in your path rather than tilde (~), especially if you enclose the new PATH in double quotes. The tilde is not expanded when it occurs in quotes.



      Testing:



      $ mkdir "$HOME/t"

      $ cat >"$HOME/t/foo" <<END
      #!/bin/sh
      echo "hello"
      END

      $ chmod +x "$HOME/t/foo"

      $ PATH="$PATH:~/t"

      $ foo
      zsh: command not found: foo

      $ PATH="$PATH:$HOME/t"

      $ foo
      hello


      See also: Why doesn't the tilde (~) expand inside double quotes?






      share|improve this answer
























        up vote
        1
        down vote



        accepted







        up vote
        1
        down vote



        accepted






        Use $HOME in your path rather than tilde (~), especially if you enclose the new PATH in double quotes. The tilde is not expanded when it occurs in quotes.



        Testing:



        $ mkdir "$HOME/t"

        $ cat >"$HOME/t/foo" <<END
        #!/bin/sh
        echo "hello"
        END

        $ chmod +x "$HOME/t/foo"

        $ PATH="$PATH:~/t"

        $ foo
        zsh: command not found: foo

        $ PATH="$PATH:$HOME/t"

        $ foo
        hello


        See also: Why doesn't the tilde (~) expand inside double quotes?






        share|improve this answer














        Use $HOME in your path rather than tilde (~), especially if you enclose the new PATH in double quotes. The tilde is not expanded when it occurs in quotes.



        Testing:



        $ mkdir "$HOME/t"

        $ cat >"$HOME/t/foo" <<END
        #!/bin/sh
        echo "hello"
        END

        $ chmod +x "$HOME/t/foo"

        $ PATH="$PATH:~/t"

        $ foo
        zsh: command not found: foo

        $ PATH="$PATH:$HOME/t"

        $ foo
        hello


        See also: Why doesn't the tilde (~) expand inside double quotes?







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Apr 3 at 11:15

























        answered Apr 3 at 10:34









        Kusalananda

        102k13201317




        102k13201317






















             

            draft saved


            draft discarded


























             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f435230%2fbinary-placed-in-folder-on-path-is-not-immediately-accessible%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)