> On May 14, 5:45 pm, James.E.W
@gmail.com wrote:
> > I am writing a script to ssh into remote machines and run tripwire.
> > I'd like it to go interactive at the point the editor (vi) fires up
> > and to resume non-interactive mode once the file is saved.
> > I have a working test script:
> > #!/usr/bin/expect
> > spawn /bin/bash
> > expect "$"
> > send "vi tt\r"
> > interact {
> > \003 return
> > }
> > send exit
> > This allows me to edit the file tt and hit CTRL-C when finished.
> > Here's the expect portion of the real script (it's run as a here
> > document, so the variables are substituted in by /bin/sh):
> > #!/usr/bin/expect
> > spawn ssh -4p8889 ${addr[$a]}
> > expect "$ "
> > send -- "sudo /usr/sbin/tripwire --check -I\r"
> > $pwd # deals with the sudo password
> Is there a reason the test script does not prepend the $ with a \ but
> the
> 'production script' does?
Probably a glitch, but as it happens it doesn't matter anyway: