Re: the tcsh login-shell problem -- ideas?

Matt Holgate <[email protected]> Wed, 29 May 2002 00:30:56 +0100
Newsgroups gmane.comp.sysutils.ark.devel
Message-ID <[email protected]>
Will Partain wrote:

 > Making this change in the ARK code gives me something better
 > -- i.e. some sign that it runs my code on the far end... --
 > but it insisted on running it in a csh, no matter what I did
 > (below).

Ah, of course - removing the exec just means it actually gets as far as
the commands, but runs them in the current shell (i.e. tcsh).

Try the following (although I only tested from a cygwin client to a
linux server with bash, ash and tcsh -- no warranties for anything else :)).

(echo "exec /bin/sh <<\"EOF\""; cat test.sh; echo; echo "exit \$?") |
ssh frodo newgrp users; echo "Exit code was $?"

The test.sh script is attached and allowed me to verify that basic
variable/command expansions thingies were working ok.

Bizarelly adding an 'echo EOF' at the end just causes the remote /bin/sh
to complain that it cannot find the command 'EOF', but missing it off
doesn't seem to hurt.

Matt.




_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm