I just noticed that my $PATH
has an invalid location:
\> $PATH
zsh: no such file or directory: /usr/bin:/bin:/usr/sbin:/sbin: ...
I use prezto and according to the docs the config files are sourced in this order:
I checked the whole list and I can't find anything that would come before /usr/bin
Any suggestion on how I could go about finding what is triggering the issue?
Thanks!
The error "FileNotFoundError: [Errno 2] No such file or directory" is telling you that there is no file of that name in the working directory. So, try using the exact, or absolute path. In the above code, all of the information needed to locate the file is contained in the path string - absolute path.
log No such file or directory” the problem is most likely on the client side. In most cases, this simply indicates that the file or folder specified was a top-level item selected in the backup schedule and it did not exist at the time the backup ran.
PATH is an environment variable where you tell your system to look for executables when you enter a command in the shell. You can inspect the value of the PATH variable by running the following.
The zsh shell provides the . zprofile under the user home directory in order to load profile related configuration. The path is ~/. zprofile and can be used like a bash profile file with zsh commands.
As far as I can tell there is nothing wrong with your PATH
. If you want to see the content of PATH
use echo
:
% echo $PATH
/usr/sbin:/usr/bin:/sbin:/bin
PATH
is a colon separated list of directories to search for commands. Essentially, zsh will try the name of your command with each path and execute the first find (/usr/sbin/foo
, /usr/bin/foo
, etc.). If any of the listed directories does not exist, there will be no error message, zsh will simply not find a binary there and try the next one.
The issue in your case is triggered by trying to execute $PATH
. Before executing a command line, zsh - among other things - replaces all variables with their content, this is called Parameter Expansion (so man 1 zshexpn
for more information on that).
So, when you just write $PATH
, zsh replaces it with /usr/bin:/bin:/usr/sbin:/sbin:...
and interpretes it as one long path. That is, :
is not taken as separator but as part of the directory names. Any you are getting the same error message you would get with any other non-existent directory:
% ls /some/path
dir1 dir2
% /some/path/nothere/notthere
zsh: no such file or directory: /some/path/nothere/notthere
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With