Re: spawn sh -c "ssh -T $host -l $user <$JOBSCRIPT" #HowCanI elim sh?



In article <1217378101.478578@xxxxxxxxxxxx>,
Name withheld by request <anonb6e9@xxxxxxxxxxxx> wrote:
pls consider this snip of expect:

spawn /bin/bash -c "ssh -T $host -l $user <$JOBSCRIPT"
# had to use the 'sh -c' approach support the '<' redirection

# ====================================================================
# wait for passwd prompt
# normal next send enters password
# ====================================================================
set __comment_on_last_send "no send yet, just spawned ssh"
expect {

"assword:" {
send "$PW\r"
set _comment_on_last_send "passwd entered, waiting on job completion..."
}
--snip

Is there a way to eliminate the bash shell in the spawn above?
Notice that the remote script is supplied as the STDIN to ssh.
.
.
.
Sure, there are ways ... They're probably going to be more
tedious to implement than the minor burden of the /bin/bash.
Is it enough to have Expect read each line of $JOBSCRIPT and
pass it to the spawned ssh? What kind of control do you have
over $JOBSCRIPT?
.