in reply to system vs backticks
I agree with Errto in that both backticks and system should preserve environment variables, so the difference is caused by something else. If you can reproduce the phenomenon with some simple code, you might want to post it here so that we can examine that and help.
Also, just to make sure, are you not passing some environment variable significant for the shell, like PS1? If so, it may be that the backticked version of your code calls a shell which destroys that variable. (I can't tell without the code if this is the case.)
|
|---|