Mail Archives: djgpp-workers/2000/10/24/03:35:27
On Mon, 23 Oct 2000, Peter J. Farley III wrote:
> open a piped command as a file: "echo #foo|"
> read one line from the piped file handle
> print the results of the read
> close the file handle
>
> Well, under DJGPP "echo #foo|" produces a blank line from the first
> read, rather than just "#foo". When I patched the test to use the
> modified command "echo \\#foo|", then the first read got "#foo" as a
> result.
Sorry for asking a Perl-illiterate question: What exactly is the
importance of the backslashes in "\\#foo"? Why does it affect the way
the above snippet works?
Also, can you outline the Perl implementation of this feature, in
terms of libc functions that get called when Perl processes the
command such as "echo #foo|"?
Anyway, my first suspicion would be some kind of buffering problem.
IIRC, the DJGPP port of Perl uses some FSEXT trick for implementing
invocations of external programs in some cases (I forget the details,
or perhaps I never knew them). If so, it could be that an fflush
and/or an fsync somewhere is what you need to fix this.
You seem to be assuming that this is a Bash problem. Why do you think
that? Does Bash 2.03 work with this example?
- Raw text -