2

If I put an executable in ~/bin I can just type the first few letters of the filename and then hit tab to let the shell finish the rest of the name.

While this works with executable programs, it does not seem to work with shell scripts. Is this the desired behavior, or am I doing something wrong?

4

Even scripts need the executable bit set.

3

You will probably have your script named similarly (starting) like an existing application or executable in $PATH (or, as Oli mentions, you forgot to make it executable).

Another thing is that it is bad practice to use language extensions in executables in $PATH, see this link

0

I'm using zsh for shell and after putting a script in /usr/local/bin it would not tab-complete. As hinted in another answer, I checked that the executable bit was set.

It turned out that I had to either source ~/.zshrc or restart my terminal (effectively logging me out and back in) to make my scripts tab-completable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.