I have a file in $HOME/bin (before you ask, yes, it is in my path) called test
which I've confirmed can be executed fine when I run it with the full path to the file. However, I get a really weird issue when I don't run it this way. When I just run test
in the terminal, it doesn't do anything and returns immediately. I know that this isn't an issue of finding the file for several reasons:
There is no error message. Normally if the file can't be found or can't be executed a message will be printed out saying so.
Running
which test
still returns the correct file path.Probably the weirdest of all - the script works fine when run through
strace
. I tried usingstrace
to see if I could figure out what was going on but when I ran it withstrace
, it worked as expected with 0 issues.
type
, notwhich
. See Why not use “which”? What to use then? – wjandrea Feb 05 '19 at 01:18