RE: Possible output redirect bug
- Date: Wed, 28 Feb 2018 22:02:12 -0500
- From: "Michel LaBarre" <michel.labarre@xxxxxxxxxx>
- Subject: RE: Possible output redirect bug
> 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