I have some important commands I need to execute before any sh shell starts. This is required for passing SSH commands in the SSH command (ssh host somecommand) and other programs that run commands.In my .profile I have this:ihammerhands@wreckcreations:~> cat .profile#specific environment and startup programsexport PS1=\u@wreckcreations:\w> export PYTHONPATH=~/python/lib/python2.4/site-packagesexport PATH=$PATH:~/bin:~/python/binHowever, this fails:W:\programming\wreckcreations-site\test-hg>ssh name@host echo $PATHEnter passphrase for key '/home/Owner/.ssh/id_rsa':/usr/local/bin:/bin:/usr/binNotice the missing PATH optionsWhat is the proper name for the sh profile? Note: I do not have root access and don't want this applied to other users. Is there another way to do this?EDIT: It appears /bin/sh links to bash, which isn't surprising. What is surprising is that my profile is still ignored. Any suggestions?
sh startup files over ssh
bash;ssh;shell;profile
It seems worth noting that the command you mention in your question ssh name@host echo $PATHwill pretty much never be useful.  The variable substitution for $PATH is done by your local shell, and passed to ssh which executes echo on the remote system to print the contents of the path variable, as it expanded on your local system.  Here is an example of me doing something similar between my Mac and a Linux machine on my network:LibMBP:~ will$ echo $PATH/opt/local/bin:/opt/local/sbin:/Users/will/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/binLibMBP:~ will$ ssh warren echo $PATHwill@warren's password: /opt/local/bin:/opt/local/sbin:/Users/will/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/binLibMBP:~ will$ ssh warren 'echo $PATH'will@warren's password: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/gamesLibMBP:~ will$ Note how I needed to use quotes to prevent my local shell from expanding the variable.