delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/10/17/02:27:25

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:mime-version
:content-type:content-transfer-encoding; q=dns; s=default; b=W73
ikFDvNKnWXFlilUhvwnNoENTCCod0uVxyWK5lS4pKmDY1fsc97kBtKaJAvoLywuB
nw/FQzXp3zdWs+druM2B6eRnMQy5+d2QRPsh6pwcGRKt5WD8N/CIj5XpaxHNToUf
9lR8s+GE0iZj7bfeqS8gJtHst9C93KfrKJkRQK80=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:mime-version
:content-type:content-transfer-encoding; s=default; bh=sIuM8188J
u7UefZ13ILwsF41pQ4=; b=gPGauM7kf+Og4tcuMq7Zyk4sxTf1QG0xc6IohqEzP
KCkq919Tg+yGe2DTKwjIciNUAGIo6qB7TjugcXTzXroV6xqmSN7hPNRyJ3OzmWpP
u+1kMeGt7Ee2JzvTjrkFShyQKU3kGEI/kYBN6C/XGOkO/GqJMJoyh7KDuN6/6REq
XM=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=1.0 required=5.0 tests=BAYES_40,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=H*UA:3.0.4, H*u:3.0.4, H*r:Unknown
X-HELO: blaine.gmane.org
To: cygwin AT cygwin DOT com
From: Thorsten Kampe <thorsten AT thorstenkampe DOT de>
Subject: /dev/stderr problem
Date: Mon, 17 Oct 2016 08:25:13 +0200
Lines: 30
Message-ID: <nu1qtk$te3$1@blaine.gmane.org>
Mime-Version: 1.0
User-Agent: MicroPlanet-Gravity/3.0.4
X-IsSubscribed: yes

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019