Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, I have an Expect script containing: Code: send -- "i 1 liabETH0=$liabETH0\r" sleep 1 expect -re ".*\r Param>" sleep 1 send -- "i 2 liabETH1=$liabETH1\r" sleep 1 expect -re ...
  1. #1
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3

    Expect / telnet skips characters

    Hello,

    I have an Expect script containing:

    Code:
    send -- "i 1 liabETH0=$liabETH0\r"
    sleep 1
    expect -re ".*\r
    Param>"
    sleep 1
    send -- "i 2 liabETH1=$liabETH1\r"
    sleep 1
    expect -re ".*\r
    Param>"
    sleep 1
    send -- "i 3 liabIP0=$liabIP0\r"
    sleep 1
    expect -re ".*\r
    Param>"
    sleep 1
    send -- "i 4 liabIP1=$liabIP1\r"
    sleep 1
    expect -re ".*\r
    Param>"
    sleep 1
    send -- "i 5 liabHOST=$liabHOST\r"
    sleep 1
    expect -re ".*\r
    Param>"
    sleep 1
    send -- "i 6 liabJFFS2=$liabJFFS2\r"
    sleep 1
    expect -re ".*\r
    Param>"
    sleep 1
    send -- "i 7 liabRUN=$liabRUN\r"
    sleep 1
    expect -re ".*\r
    Param>"
    ...but I get some strange hickups. Every now and then a letter disappears in the output I see in my terminal. If for instance $liabHOST is "name.domain.dk" i see
    Code:
    Param>i 5 liabHOST=nme.domain.dk
    but in the program in question (a bootloader) did get the full string when I check afterwards. liabHOST is "name.domain.dk".

    These random hickups are really bugging me, as I need to present the output from the expect script in a Gtk UI, and sometimes this fails with a "Gtk-CRITICAL **: gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)' failed" error, whenever the expect scripts do something strange.,

    Can anyone point me in the direction of a solution?

  2. #2
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    Thats since Telnet Sends while it is connected.
    So everytime you hit a button he sends that you hit that button.
    I did know how to fix it.. but well, sorry I forgot.

    Check with TCPDump then you see you send everything..
    New Users, please read this..
    Google first, then ask..

  3. #3
    Just Joined!
    Join Date
    Sep 2007
    Posts
    3
    Thanks for the reply - it seems that the program I used to do the communication was the one dropping characters.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...