This is the mail archive of the
mailing list for the Cygwin project.
RE: Possible output redirect bug
- From: "Michel LaBarre" <michel dot labarre at rogers dot com>
- To: "'Alexander Pelevin'" <pvshura at mail dot ru>, <cygwin at cygwin dot com>
- Date: Wed, 28 Feb 2018 22:02:12 -0500
- Subject: RE: Possible output redirect bug
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org>
> Subject: Possible output redirect bug
> Error output is not suppressed:
> $ cygstart cmd /c "( >&2 pause ) >> test.txt"
> $ cat /dev/null >> test.txt >/dev/null 2>&1
> bash: test.txt: Device or resource busy
The error message is not from the process running "cat" which is to what the
The message is coming from the shell trying to setup file descriptors to
pass to the process running "cat" - you can see "bash:"
The shell cannot open the file for appending.
A simpler demonstration is:
$ cat < zorch > /dev/null 2>&1
bash: zorch: No such file or directory
$ ls zorch
ls: cannot access 'zorch': No such file or directory
shows std err is from "ls" and:
$ ls zorch 2> /dev/null
demonstrates redirection working.
( cat /dev/null >> test.txt ) >/dev/null 2>&1
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple