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:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; q=dns; s=default; b=WM5nsCN4gEuVZno6myKKBFGjGJBzH1PQAAgIbr8X/Hx SF7SPySKXEahuwPNLeqL6GAxulekQHzNMUpUc0lnsTFVPoQZX2KMrhoaffiaTAv6 j6Iw70HnX+1N/1eha8SB4b31nKQ7pV1rdUzB1gC0qgO1m/JOnQMudvM1UlXfsnhw = 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:message-id:date:from:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; s=default; bh=hJfscbipHRzi21HehK9LnD8wuQc=; b=KqDwiodmiarGIHFRo KXBRErWff0jB9qlGu/qD4LQqYkbQ/HBf/hTc2FF7b2MczTpPJRrcEUMzrLB+Ctbu knxsj5ISv+SSEWTO7jNnmlhxvcZyXmwyG2fQcG8OhXMYvBIaj3P7dOD1fstwhBan KyDngHTofnV075C+OSRmsLJbeA= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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=0.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=thorsten, taught, shopt, kampe X-HELO: Ishtar.sc.tlinx.org Message-ID: <580511C4.3050007@tlinx.org> Date: Mon, 17 Oct 2016 11:00:36 -0700 From: Linda Walsh User-Agent: Thunderbird MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: /dev/stderr problem References: <1957a989-fe56-ca68-ddc2-83bc59480ccd AT redhat DOT com> In-Reply-To: <1957a989-fe56-ca68-ddc2-83bc59480ccd@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Eric Blake wrote: > 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. --- Is /dev/stderr a POSIX special name that one should expect that rewinding is disallowed or ignored? Good analysis, BTW, that sure would have puzzled me. -l > -- 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