On Wed, Mar 23, 2005 at 05:07:58PM +0100, Cristian Zoicas wrote:
> When ssh is started interactively, it starts a login shell, but when it is
> started in batch mode (e.g. ssh user@some.site.com command) it runs my
> command under an interactive shell.


It doesn't do that for me. From man bash:

An interactive shell is one started without non-option arguments and
without the -c option whose standard input and output are both con-
nected to terminals (as determined by isatty(3)), or one started with
the -i option. PS1 is set and $- includes i if bash is interactive,
allowing a shell script or a startup file to test this state.

And on my system:

imadev:~$ ssh localhost 'echo $-'
wooledg@localhost's password:
hBc

imadev:~$ ssh localhost 'echo $PS1'
wooledg@localhost's password:


(That's a blank line after the password prompt.)

> The ssh version that I use is OpenSSH_3.6.1p2


OpenSSH 3.9p1 for me, on HP-UX 10.20, with bash 2.05b.