Last Updated: February 25, 2016
·
516
· cesario

Using multiple .netrc files by instrumenting HOME

Most Unix tools/convention can have their default overridden by environment variables. Below, .netrc and the HOME variable:

franck@zeu ~ % HOME=.ssh/heroku-franck heroku apps
=== My Apps
...

=== Collaborated Apps
[redacted]

franck@zeu ~ % HOME=.ssh/heroku-evome heroku apps
You have no apps.


# https://gist.github.com/franckverrot/8783182

FWIW, I store my .netrc files in .ssh.

And of course, it's easy add some sugar to avoid typing "HOME=/thepath", but I don't bother doing it.