weird resolving of path to command

Posted by Eldamir on Super User See other posts from Super User or by Eldamir
Published on 2012-11-04T10:21:03Z Indexed on 2012/11/04 11:06 UTC
Read the original article Hit count: 364

Filed under:
|
|

I have the terminal editor 'nano' installed in two places on my mac

/usr/bin/nano

/opt/local/bin/nano

The installations are of different versions. the one in /usr does not support my configuration in ~/.nanorc and the one in /opt does.

when i open a file with the command 'nano file', errors are displayed, indicating that the one in /usr was used, however, if i run 'which nano'; the one in /opt shows up.

Isn't 'which' meant to search the path for the default? And why wouldn't a call to 'nano' resolve to the same path?

EDIT: I made a work-around by adding the following line to ~/.profile

alias nano='/opt/local/bin/nano'

© Super User or respective owner

Related posts about mac

Related posts about path