in reply to Expect Question

Do you mean that you want to capture the output of ls -l?

Why would you need Expect for this at all? Have a look at the Expect.pm documentation and the answer to the question "I just want to read the output of a process without expect()ing anything. How can I do this?": http://search.cpan.org/~rgiersig/Expect-1.15/Expect.pod

If the output of the command is very long then I'd recommend to redirect the STDOUT of the command to a file and then later on process this file.

Replies are listed 'Best First'.
Re^2: Expect Question
by tmaly (Monk) on Jul 14, 2009 at 13:58 UTC

    I need to log into a remote machine via an intermediate proxy, so I cannot simply just read the output like in the example doc.

    I have attempted to read the output, but it only reads a small portion of the output and not the whole amount.

      OK, I now understand why you want to use Expect. I'm using it in a similar way, but I never got to the problem that it's not reading the whole output. But you can still redirect the output to a file and then process this file (you might want to copy the file to your local machine first).