in reply to (Expect) Re: question for open2, and by the way, resolves an old thread
in thread question for open2, and by the way, resolves an old thread
There is no prompt being printed between two prints. So it means/proves that the prompt is NOT THERE, doesn't matter what it is, but I do like tye's suggestion, it is 100% logical.#!/usr/bin/perl use IPC::Open2; use strict; my ($reader, $writer); my $pid = open2($reader, $writer, "sh") || die "failed"; print $writer "history\n"; my $buffer; sysread($reader, $buffer, 4000); print "[", $buffer, "]\n"; print $writer "ls\n"; sysread($reader, $buffer, 4000); print "[", $buffer, "]\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: question for open2, and by the way, resolves an old thread ($/)
by tye (Sage) on Jan 17, 2003 at 20:43 UTC |