Re: Redirection to stderr
- Date: Mon, 10 Jul 2017 12:32:45 -0400
- From: Eliot Moss <moss@xxxxxxxxxxxx>
- Subject: Re: Redirection to stderr
On 7/10/2017 9:41 AM, Peter Schneider wrote:
On Mon, July 10, 2017 14:55, Andrey Repin wrote:
On Mon, July 10, 2017 12:33, Marco Atzeri wrote:
On 10/07/2017 11:06, cygwin-mailinglist wrote:
Rationale aside, it is a bug, isn't it?
I guess a side effect of a lost race.
Which race, exactly?
echo aaa > a
cat a > a
The problem with "cat a > a" is entirely unrelated to "some-cmd
2>/dev/stderr". (Apart from /dev/stderr not being a regular file, some-cmd
does not receive a path argument which it tries to open, the way "cat a"
Understanding what is happening would require figuring out which process
opens /dev/stderr and when. However, there is another approach that might
get at what you want: /proc/nnnn/fd/2 gives access to file descriptor 2
(standard error) of process number nnnn. If you can get the right pid,
and you have access rights, then you can open that. Here the PPID
environment variable may be useful.
Which stderr is it you're hoping the output will go to?
Regards - EM
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple