binary placed in folder on $PATH is not immediately accessible

Clash 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?
zsh path executable
add a comment |Â
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?
zsh path executable
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$PATHmatter 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
add a comment |Â
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?
zsh path executable
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?
zsh path executable
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$PATHmatter 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
add a comment |Â
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$PATHmatter 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
add a comment |Â
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?
add a comment |Â
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?
add a comment |Â
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?
add a comment |Â
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?
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?
edited Apr 3 at 11:15
answered Apr 3 at 10:34
Kusalananda
102k13201317
102k13201317
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
$PATHmatter 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