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:references :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=KDCwvc7QURY9OhVLnpkDSKfDsIH6fmQuaWhxJPn1rXMKphB8plMax MSV60qB/bB2qTNbu4VkrAW3SiowtHRP2tDaeeYJru8z1SvRMFqLMT1dQwLKI+X17 xod6DZcxbJy/IAebWYWfnQnSm2OoNFBprz0M67hKg0gIb8UJn4H1DI= 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:references :mime-version:content-type:content-transfer-encoding; s=default; bh=kKNVZFdUvmfBsDGh9mg5fQ6nNMQ=; b=M3+jHM2cIbCzWL2kdeLLMToI1mZw jmD4ZN/LtoafPno7WTIfA63TTHyAUrGEzkstxa7lzx+gEuaFN/4RsQvCG9YC/SxZ p7oZUYOtwWyqhttO2CD2R1wi7cDJpTKVZKEzsMEGG00lUPDaBgftgiQVQqa/DkNF 58ZK7gdN+5eJG5o= 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=2.5 required=5.0 tests=BAYES_60,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=H*UA:3.0.4, thorsten, H*u:3.0.4, scriptsh X-HELO: blaine.gmane.org To: cygwin AT cygwin DOT com From: Thorsten Kampe Subject: Re: /dev/stderr problem Date: Mon, 17 Oct 2016 08:32:20 +0200 Lines: 32 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit User-Agent: MicroPlanet-Gravity/3.0.4 X-IsSubscribed: yes * 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 > ``` On further inspection: the `xtrace` is not related to the problem: script.sh ``` printf "FIRST LINE\n" > /dev/stderr printf "SECOMD LINE\n" > /dev/stderr ``` ``` $ bash script.sh FIRST LINE SECOMD LINE $ bash script.sh 2> file && cat file SECOMD LINE $ file /dev/stderr /dev/stderr: symbolic link to /proc/self/fd/2 ``` 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