3

I have a Python script called aws that is stored in ~/Library/Python/3.6/bin on my computer that runs under Mac OSX 10.12.6. The folder is also listed in the PATH environment variable so that I can invoke aws from the command line. aws is found and it works nicely.

What puzzles me is that the which command line utility does not see the aws script. Example:

$ which vim
/usr/bin/vim
$ which aws
$ 

Why does it find vim but does not find aws?

Matthias Bohlen
  • 401
  • 2
  • 7
  • 2
    this seems to be a similar issue as to one addressed in [this question](https://apple.stackexchange.com/questions/73965/why-which-command-does-not-give-you-the-correct-path). In short "`which` is an external program, which tries to determine how your shell will resolve a command from the existing $PATH, but it is possible for it to get it wrong." – Karan Shishoo Nov 12 '18 at 09:23
  • Thanks for the hint. I did "type aws" and it says "aws is /Users/myself/Library/Python/3.6/bin/aws". – Matthias Bohlen Nov 12 '18 at 09:28
  • 2
    Try using `type -p` – donkopotamus Nov 12 '18 at 09:29
  • This source code may help you to understand why it ignores your aws script: https://opensource.apple.com/source/shell_cmds/shell_cmds-170/which/which.c – jarmod Nov 12 '18 at 13:57
  • what does ‘ls -l aws’ show, in that directory? – JL Peyret Nov 13 '18 at 00:34

0 Answers0