thornate
thornate

Reputation: 5142

OSX Terminal - application listed by 'which' does not run by default

I followed instructions on this page to change the profile of the Mac terminal when I'm running SSH. The short explanation is that it puts a wrapper script in /usr/local/bin that changes the colour then calls /usr/bin/ssh. When I call this script with the full path it works perfectly, but when I call 'ssh', it appears to use the regular application without the wrapper script.

When I call 'which ssh', the result is '/usr/local/bin/ssh'. My PATH variable is '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin', which looks fine for me. The wrapper script has executable permissions ('-rwxr-xr-x ').

What am I missing? Why would the regular ssh be called rather than than the wrapper script, given the 'which' command points to the one that I want?

Upvotes: 0

Views: 36

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799210

You forgot to clear bash's program location cache.

hash -d ssh

Upvotes: 1

Related Questions