I'm fairly new to this and encountered a problem
I tried to run simple script in the terminal on macOS and read through other threads about where to put scripts and add them to the PATH
.
So now I have scripts in ~/bin
which I'd like to run but it always says Command not found
even though ~/bin
is in my PATH
.
When I put the same script into /usr/local/bin
the autocompletion works and I can run them just with scriptname
When I'm in ~/bin
I can also run the script by ./scriptname
but I would rather just type scriptname
and would prefer a solution without introducing aliases
for every script.
What am I missing?
SOLVED
putting $HOME/bin
into the PATH
rather than ~/bin
solves the problem.
question from:
https://stackoverflow.com/questions/66061476/running-a-script-in-zsh-without-before-works-in-usr-local-bin-but-not-bin 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…