GNU bug report logs - #22205
tee bug?

Previous Next

Package: coreutils;

Reported by: Nacho Esteban <juanignacio.esteban <at> alliance-healthcare.net>

Date: Fri, 18 Dec 2015 16:31:03 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Nacho Esteban <juanignacio.esteban <at> alliance-healthcare.net>
To: 22205 <at> debbugs.gnu.org
Subject: bug#22205: tee bug?
Date: Fri, 18 Dec 2015 14:18:07 +0100
[Message part 1 (text/plain, inline)]
Hi team,

I detected an strange behaviour of tee command that may bee a bug.

Please consider this script snippet

   VAR=""

   A() {
        VAR="This is my value"
        echo "VAR in $FUNCNAME: $VAR"
   }

   BA() {
        A | tee /tmp/kk
        echo "VAR in $FUNCNAME: $VAR"
   }

This is the output when when executed:

   $ BA
   VAR in A: This is my value
   VAR in BA:


I miss the value of VAR inside BA function.



In fact if "| tee /tmp/kk" is removed value of VAR is properly visible 
from BA function:

   VAR=""

   A() {
        VAR="This is my value"
        echo "VAR in $FUNCNAME: $VAR"
   }

   BA() {
        A
        echo "VAR in $FUNCNAME: $VAR"
   }


   $ BA
   VAR in A: This is my value
   VAR in BA: This is my value


Many thanks for your priceless effort,
Nacho


*Juan Ignacio Esteban*

Integration Architect & Security Officer | Integration Centre of Expertise


*Walgreens Boots Alliance - Enterprise IT Shared Services - Retail 
Pharmacy International & Pharmaceutical Wholesale*

Pol. Ind. San Miguel Sector 4 | Villanueva de Gállego | Zaragoza (Spain) 
| 50830

*Member of Walgreens Boots Alliance *




Walgreens Boots Alliance Services Limited is registered in England & Wales with
company number 7073433 
Registered Office: 2 The Heights, Brooklands, Weybridge, Surrey, KT13 0NY 
Walgreens Boots Alliance Services Limited is a member of Walgreens Boots
Alliance. 

This e-mail (including any attachments) is confidential and may be privileged or
otherwise protected. It may be read, copied and used only by the intended
recipient. If you are not the intended recipient you should not copy it or use it
for any purpose or disclose its contents to another person. If you have received
this message in error, please notify us and remove it from your system. Messages
sent to and from companies in the Walgreens Boots Alliance company may be
monitored to ensure compliance with internal policies and to protect our
business. Emails are not secure and cannot be guaranteed to be error free. We
cannot accept liability for any damage you incur as a result of virus infection.
[Message part 2 (text/html, inline)]

This bug report was last modified 9 years and 159 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.