bash: any way to reuse the last output?

Herculano de Lima Einloft Neto hlen at ig.com.br
Fri Jan 23 22:13:53 UTC 2004


Bill Rugolsky Jr. wrote:
> Piping the output to another process causes stdio buffering
> which is not what you want.  You need pty terminal handling.

Could you tell me why is that?

> One could use expect's "interact" command to save the output of each
> command in a ring of files (say 0-9) in a spool directory.

I've been going over expect(1), but am stuck. Would you give me some
pointers on how I could save all the output between two expect positives
to a file?

#!/usr/local/bin/expect -f

spawn $env(SHELL)
interact
expect "*\]\$ " #will do for now

#something here..?

Thanks a lot, interesting stuff
Special thanks also to Mike Klinke and Ben Stringer
--
Herculano de Lima Einloft Neto





More information about the fedora-list mailing list