[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BUG REPORT: Bash read builtin not working correctly

From: John Mellor
Subject: BUG REPORT: Bash read builtin not working correctly
Date: Tue, 25 Feb 2003 12:42:20 -0500

Configuration Information [Automatically generated, do not change]:
Machine: sparc
OS: SunOS5
Compiler: cc
uname output: SunOS tarpon 5.7 Generic_106541-19 sun4u sparc 

Bash Version: 1.14
Patch Level: 4

        The read builtin does not work correctly in most scenarios.
                If I read from stdin, where stdin is a pipe then nothing is 
                However, if I read from a terminal, it behaves as expected.
                This makes virtually all scripts using read malfunction.  
Critical bug.

                Also shown to fail on:
                        bash 2.05b.0 on RedHat 8.0.93 (Phoebe beta-2)
                        bash 2.02 on RedHat 7.3
                        bash 1.14 on Solaris 9

                $ read a b c
                d e f
                $ echo $a $b $c
                d e f
                $ # note: this works as expected.
                $ echo x y z | read a b c
                $ echo $a $b $c
                d e f
                $ # note: dangerous bug, old values not even overwritten
                $ echo x y z | read u v w
                $ echo $u $v $w
                $ # note: bad bug, no values read in as per posix, ksh, etc. 
                $ echo x y z | read u v w
                $ echo $?
                # note: RC should be nonzero if it didn't work.  Fatal bug 
breaks almost every script.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]