Expect script help

Página Inicial
Anexos:
Mensagem como email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Autor: Shawn Badger
Data:  
Para: Main PLUG discussion list
Assunto: Expect script help
I am trying to get the stdout form a grep statement into a new file from
within a expect script. I can't figure out how to get the redirect working
form within expect. here is my code snippet if that help anyone:


expect {
            assword: {
                send $PASS\n}
            no)? {
                send yes\n}
            refused {
                exit 1}
            known_hosts: {
                spawn /bin/cp $HOMESSH/known_hosts $HOMESSH/known_hosts.bak;
                spawn /bin/grep -v $SOMEIP $HOMESSH/known_hosts.bak >
$HOMESSH/known_hosts;
                spawn /usr/bin/scp $HOSTFOLDER/$HOSTFILE
$USER@$SOMEIP:$DESTFOLDER/$DESTFILE;
                expect {
                    no)? {
                    send yes\n}
                    }
                }



Basically this is part of a script to scp files to any host within an IP
range. I need to account for new host showing up with same IP address as an
old one. This little snippet of code should in theory remove the problem IP
and then continue on. Any help will be appreciated because Google has yet
to turn up anything.

Thanks
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss