Your message dated Fri, 25 Mar 2005 23:29:14 +0100
with message-id <[EMAIL PROTECTED]>
and subject line Bug#301433: bash: variables revert to original values when 
exiting loop involving read
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 25 Mar 2005 21:32:49 +0000
>From [EMAIL PROTECTED] Fri Mar 25 13:32:47 2005
Return-path: <[EMAIL PROTECTED]>
Received: from gw.ptr-80-238-131-68.customer.ch.netstream.com 
(phaedrus.azadian.ch) [80.238.131.68] 
        by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1DEwQA-0002vl-00; Fri, 25 Mar 2005 13:32:46 -0800
Received: from naz by phaedrus.azadian.ch with local (Exim 4.44)
        id 1DEwPc-0006tF-TJ; Fri, 25 Mar 2005 22:32:12 +0100
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: "Norman H. Azadian" <[EMAIL PROTECTED]>
To: Debian Bug Tracking System <[EMAIL PROTECTED]>
Subject: bash: variables revert to original values when exiting loop involving 
read
X-Mailer: reportbug 2.63
Date: Fri, 25 Mar 2005 22:32:12 +0100
Message-Id: <[EMAIL PROTECTED]>
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Package: bash
Version: 2.05b-24
Severity: important

The following script illustrates the problem:

        #!/bin/sh

        val=initial
        cat <<-EOF | while read ;do
                first line
                second line
                EOF
            val=$REPLY
            echo "val is '$val'"
        done
        echo "final val is '$val'"

When I run this, I get:

        val is 'first line'
        val is 'second line'
        final val is 'initial'

I suspect this only happens with read, but I'm not sure.


-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.11A
Locale: LANG=C, LC_CTYPE=C

Versions of packages bash depends on:
ii  base-files                  3.1.0        Debian base system miscellaneous f
ii  libc6                       2.3.2.ds1-18 GNU C Library: Shared libraries an
ii  libncurses5                 5.4-4        Shared libraries for terminal hand
ii  passwd                      1:4.0.3-30.4 Change and administer password and

-- no debconf information

---------------------------------------
Received: (at 301433-done) by bugs.debian.org; 25 Mar 2005 22:29:22 +0000
>From [EMAIL PROTECTED] Fri Mar 25 14:29:21 2005
Return-path: <[EMAIL PROTECTED]>
Received: from mail.cs.tu-berlin.de [130.149.17.13] (root)
        by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1DExIv-00063f-00; Fri, 25 Mar 2005 14:29:21 -0800
Received: from mailhost.cs.tu-berlin.de ([EMAIL PROTECTED] [130.149.17.13])
        by mail.cs.tu-berlin.de (8.9.3p2/8.9.3) with ESMTP id XAA10039;
        Fri, 25 Mar 2005 23:29:17 +0100 (MET)
Received: from localhost (localhost [127.0.0.1])
        by mailhost.cs.tu-berlin.de (Postfix) with ESMTP id CBD9BF217;
        Fri, 25 Mar 2005 23:29:16 +0100 (MET)
Received: from mailhost.cs.tu-berlin.de ([127.0.0.1])
 by localhost (bueno [127.0.0.1]) (amavisd-new, port 10224) with ESMTP
 id 20858-30; Fri, 25 Mar 2005 23:29:15 +0100 (MET) 11244
Received: from bolero.cs.tu-berlin.de (bolero.cs.tu-berlin.de [130.149.19.1])
        by mailhost.cs.tu-berlin.de (Postfix) with ESMTP;
        Fri, 25 Mar 2005 23:29:15 +0100 (MET)
Received: (from [EMAIL PROTECTED])
        by bolero.cs.tu-berlin.de (8.12.10+Sun/8.12.8/Submit) id j2PMTEDi023923;
        Fri, 25 Mar 2005 23:29:14 +0100 (MET)
From: Matthias Klose <[EMAIL PROTECTED]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <[EMAIL PROTECTED]>
Date: Fri, 25 Mar 2005 23:29:14 +0100
To: "Norman H. Azadian" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
Subject: Re: Bug#301433: bash: variables revert to original values when exiting 
loop involving read
In-Reply-To: <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
X-Mailer: VM 7.03 under 21.4 (patch 6) "Common Lisp" XEmacs Lucid
X-Virus-Scanned: by amavisd-new at cs.tu-berlin.de
Delivered-To: [EMAIL PROTECTED]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
        autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Norman H. Azadian writes:
> Package: bash
> Version: 2.05b-24
> Severity: important
> 
> The following script illustrates the problem:
> 
>       #!/bin/sh
> 
>       val=initial
>       cat <<-EOF | while read ;do
>               first line
>               second line
>               EOF
>           val=$REPLY
>           echo "val is '$val'"
>       done
>       echo "final val is '$val'"
> 
> When I run this, I get:
> 
>       val is 'first line'
>       val is 'second line'
>       final val is 'initial'
> 
> I suspect this only happens with read, but I'm not sure.

not a bug, the variable is set in another process (while ... done)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to