Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an interdependent collection of scripts in my ~/bin directory as well as a developed ~/.vim directory and some other libraries and such in other subdirectories. I've been versioning all of this using git, and have realized that it would be potentially very easy and useful to do development and testing of new and existing scripts, vim plugins, etc. using a cloned repo, and then pull the working code into my actual home directory with a merge.

The easiest way to do this would seem to be to just change & export $HOME, eg

cd ~/testing;  git clone ~ home
export HOME=~/testing/home
cd ~
screen -S testing-home
# start vim, write/revise plugins, edit scripts, etc.
# test revisions

However since I've never tried this before I'm concerned that some programs, environment variables, etc., may end up using my actual home directory instead of the exported one. Is this a viable strategy? Are there just a few outliers that I should be careful about? Is there a much better way to do this sort of thing?

share|improve this question
up vote 1 down vote accepted

The problem with this is that some applications may choose to ignore $HOME and instead query the userdb via getpwent(3) directly. The safest thing to do would be to create an entirely new user and either use su or sudo to become them or log in as them from another terminal/VT.

share|improve this answer
Any idea which or what proportion of apps would do this? EG Vim does seem to respect $HOME. – intuited Apr 21 '10 at 12:52
Not of the top of my head, no. It shouldn't be especially high though. – Ignacio Vazquez-Abrams Apr 21 '10 at 13:34

You must log in to answer this question.

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