Purl said:
Andrei Alexandrescu wrote:
There is nothing "factually" about your comments.
Your statements are both incorrect and do not comply with
your original article. You have changed your parameters which
is a strong indicator of a troll.
This might be a misunderstanding. I haven't changed anything. I've just
done my best to explain the problem I was facing, and then I confirmed
that eof is not the answer to that problem. Most people on this group
understood my question. I won't spend any more time focusing on whether
my words can be interpreted in ways that could make your initial answer
plausible. Again, most (actually, all other) posters understood what I
was asking for, and gave salient answers.
You originally wrote,
"Now, inside my_perl_script, when reading STDIN through end-of-file, I
want to look at the exit status of the "upstream" command, that is,
some_command. If that command has a nonzero exit status, I deem the
input as incomplete.
How can I do that in perl? Is there a way of figuring out the exist
status of STDIN, in case that came as a pipe?"
You indicate "end-of-file," "upstream command," and "input as incomplete."
You specifically ask for the "exist" status of STDIN.
All of those conditions are ascertained by an eof signal.
(I corrected in a subsequent post "exist" with "exit".)
I don't understand how the eof signal can tell me what was the exit
status of the process that might have engendered the STDIN stream. If
you could post me some code, I'd be grateful.
So, to illustrate my question with an example in an attempt to clear any
possible misunderstandings:
$ (echo "blah"; exit 0) | my_perl_script
$ (echo "blah"; exit 1) | my_perl_script
I want my_perl_script to be able to detect that exit code, even though
their STDIN contents is the same. My current understanding is that that
is not possible without additional scaffolding.
(By the way, the "pipestatus" environment variable makes that
information available on some shells, but only for the last foreground
pipeline.)
Your current comments directly contradict your orignal article,
and contain inflammatory comments, some of which, have
been snipped.
Well isn't there at least a possibility that your current understanding
of my problem directly contradicts your understanding of my original
article?
Rather clear you are a troll.
You may want to plonk me and disregard all of my posts.
Andrei