Is there a way to run a command "as if" it is in a new login session?
I've already tried env -i. However, I don't want to deal with various ENV variables I have to set or unset.
I've also tried bash -c "some command" and bash -l -c "some commmand", but they all copy the current environment.
The closest I have come is a ghetto solution: ssh me@localhost "some command"
/bin/bash --loginto get that behavior. I use it e.g. to get a proper$PATH. – Daniel Beck Aug 4 '11 at 14:50/bin/bash --l, which I already tried. It copies the original environment. Try it:export SOME_VAL=something. Then/bin/bash --login. Thenenv | grep SOME_VAL. The value will be there. – dgo.a Aug 4 '11 at 15:03