This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

/dev/stderr problem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]