Re: Except script error

From: Jürgen Exner (jurgenex_at_hotmail.com)
Date: 01/14/05

  • Next message: Joe Smith: "Re: Listening for files in a directory"
    Date: Fri, 14 Jan 2005 16:14:11 GMT
    
    

    ruud wrote:
    > I am rewriting my Except script from bash to Perl.
    > But i get an syntax error at the Send command.
    > Google is not helping me out here, so i hope for an answer here.
    >
    > Here is a part of the script:
    >
    > #!/usr/bin/perl -w
    > use Expect;
    >
    > $post = "post";
    > $quit = "quit";
    >
    > spawn telnet "news.nl-netwerken.com 119";
    >
    > expect {
    > 200}
    >
    > send "$post\r";
    > expect {
    > 340}
    >
    > And here is the error:
    > syntax error at ./p line 12, near "send"
    > Execution of ./p aborted due to compilation errors.
    >
    > What is wrong with this line ?

    Nothing. The problem is with the preceeding code segment. What is

    > expect {
    > 200}

    supposed to mean? It's not a function call, it's not a statement, it's not a
    hash element, ...

    Rearranging the white space you have a single statement

        expect {200} send "$post\r";

    That doesn't look right to me.

    jue

    > Thanks for your time.


  • Next message: Joe Smith: "Re: Listening for files in a directory"

    Relevant Pages