Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.