run.pl
Do you remember Marcus' sample translator that ran `fortune`?
(http://www.debian.org/Lists-Archives/debian-hurd-0003/msg00013.html)
Here is a simplified, and rather sloppy, version in Perl.
#!/bin/perl
use Hurd::Trivfs;
if (!@ARGV) {
die "Usage: $0 command arg...\n";
}
$support_write = 0;
$/ = undef;
@Run::ISA = ('Hurd::Trivfs');
Run->start;
exit 0;
sub Run::io_read {
my ($self, $prot, $bufref) = @_;
if ($prot->po->hook) {
# After the first read, return eof.
$$bufref = '';
} else {
$prot->po->hook (1);
$$bufref = `@ARGV`;
}
}
btw, this program requires Pith -
http://john-edwin-tobey.org/Hurd/pith-0.3.tar.gz
settrans -fgac test ~/hurd/run.pl fortune
--
John Tobey, late nite hacker <jtobey@john-edwin-tobey.org>
\\\ ///
]]] With enough bugs, all eyes are shallow. [[[
/// \\\
Reply to: