This is the mail archive of the
cygwin
mailing list for the Cygwin project.
/dev/stderr problem
- From: Thorsten Kampe <thorsten at thorstenkampe dot de>
- To: cygwin at cygwin dot com
- Date: Mon, 17 Oct 2016 08:25:13 +0200
- Subject: /dev/stderr problem
- Authentication-results: sourceware.org; auth=none
Hi,
the following bash script results in a different output when
redirected to a file.
```
printf "FIRST LINE\n" > /dev/stderr
shopt -os xtrace
printf "SECOMD LINE\n" > /dev/stderr
```
```
$ bash script.sh
FIRST LINE
+ printf 'SECOMD LINE\n'
SECOMD LINE
```
```
$ bash script.sh 2> file && cat file
SECOMD LINE
```
When I use `>&2` instead of `> /dev/stderr` the problem does not
occur.
Since this problem does not occur on Linux but also with Zsh on
Cygwin, I think this is a Cygwin issue.
Thorsten
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple