Re: spawn sh -c "ssh -T $host -l $user <$JOBSCRIPT" #HowCanI elim sh?
- From: anonb6e9@xxxxxxx (Name withheld by request)
- Date: 31 Jul 2008 00:28:40 GMT
In article <gcs4m5-0qv.ln1@xxxxxxxxx>, Cameron Laird <claird@xxxxxxxxx> wrote:
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.
OK then I can stick to bash, or a smaller shell.
(cygwin comes w/a small shell called 'ash'.)
Is it enough to have Expect read each line of $JOBSCRIPT and
pass it to the spawned ssh?
I'm not smart enough to know, I could test your soln though.
What kind of control do you have over $JOBSCRIPT?
not much, I'm using the expect script as a wrapper/launcher for cygwin
cron jobs (so just about any script needs to be sypported). The user's
credentials in a cygwin cron job are not sufficent to write to remote
(network) drives, hence the password-authenticated ssh session.
--
thanks very much for your help
.
- Follow-Ups:
- Re: spawn sh -c "ssh -T $host -l $user <$JOBSCRIPT" #HowCanI elim sh?
- From: Cameron Laird
- Re: spawn sh -c "ssh -T $host -l $user <$JOBSCRIPT" #HowCanI elim sh?
- References:
- spawn sh -c "ssh -T $host -l $user <$JOBSCRIPT" #HowCanI elim sh?
- From: Name withheld by request
- Re: spawn sh -c "ssh -T $host -l $user <$JOBSCRIPT" #HowCanI elim sh?
- From: Cameron Laird
- spawn sh -c "ssh -T $host -l $user <$JOBSCRIPT" #HowCanI elim sh?
- Prev by Date: How do I find out the default color used in my TK GUI?
- Next by Date: why expect make the Chinese code garbled
- Previous by thread: Re: spawn sh -c "ssh -T $host -l $user <$JOBSCRIPT" #HowCanI elim sh?
- Next by thread: Re: spawn sh -c "ssh -T $host -l $user <$JOBSCRIPT" #HowCanI elim sh?
- Index(es):
Relevant Pages
|