public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: cygwin@cygwin.com
Subject: Re: /dev/stderr problem
Date: Mon, 17 Oct 2016 18:11:00 -0000	[thread overview]
Message-ID: <1957a989-fe56-ca68-ddc2-83bc59480ccd@redhat.com> (raw)
In-Reply-To: <nu1rav$te3$2@blaine.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 857 bytes --]

On 10/17/2016 01:32 AM, Thorsten Kampe wrote:
> * Thorsten Kampe (Mon, 17 Oct 2016 08:25:13 +0200)
> 
>> 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

Cygwin treats '> /dev/stderr' as a request to truncate /dev/stderr (or,
for that matter, any opening of a file under /proc/self/fd).  Other
platforms treat that as a special file that can never be truncated, but
is instead reopened at the same offset.

Maybe cygwin can be taught that opening a file through /proc/self/fd
should preserve rather than reset offsets, but it will be a tricky
patch, and someone has to write it.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2016-10-17 13:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17  6:34 Thorsten Kampe
2016-10-17 13:51 ` Thorsten Kampe
2016-10-17 18:11   ` Eric Blake [this message]
2016-10-17 18:29     ` Linda Walsh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1957a989-fe56-ca68-ddc2-83bc59480ccd@redhat.com \
    --to=eblake@redhat.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).