Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
339 views
in Technique[技术] by (71.8m points)

macos - Running a script in zsh without ./ before works in /usr/local/bin but not ~/bin

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...