OK - I've been playing with *nix for a while, but I ran into this issue and it's probably something really obvious. I'm just not seeing it.
If I ssh into a box and type in a command (it doesn't matter) at the prompt, I get my expected results. If I send the command directly via ssh, I get different results.
I figured out the the environment variables change depending on how I do the command. For example, if I log into my box via ssh and I type in "set", I get all my environment variables and they are correct. If I log back out, and type in, "ssh $SERVER 'set'", I get a completely different set of variables.
What's going on here?