0

I have followed the suggestion in this answer How do you update the default version of Nano on MacOS without using the homebrew package manager?

I have macOS High Sierra. After the installation I have tried:

$ nano -V

And the output is:

GNU nano version 2.0.6 (compiled 19:06:01, Oct  6 2017)
 Email: nano@nano-editor.org    Web: http://www.nano-editor.org/
 Compiled options: --disable-nls --enable-color --enable-extra --enable-multibuffer --enable-nanorc --enable-utf8

So I have tried to see where nano is located:

$ which nano

and the output is

/usr/local/bin/nano

Checking the path:

$ echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin

I don't understand, if the first path is where nano is installed, why the new version is not available.

2

If you run a binary from our shell, the shell stores its path within PATH in a cache. If you then install a new version of this binary in a different location the shell won't notice this and keep running the previous version. See the COMMAND EXECUTION section in man bash for details on this, you can also run hash -t nano to see the currently used version of nano.

To clear the cache run hash nano (to have the shell rescan all directories in PATH) or hash -r (to forget all cached paths).

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .