> -----Ursprüngliche Nachricht----- > Von: Chet Ramey [mailto:chet.ra...@case.edu] > Gesendet: Mittwoch, 19. Dezember 2012 22:50 > An: Fiedler Roman > Cc: chet.ra...@case.edu; bug-bash@gnu.org > Betreff: Re: AW: Questions to bash "read" builtin functionality > > On 12/17/12 3:34 AM, Fiedler Roman wrote: > > > From your description, I would expect > > > > --- HYPOTHETICAL-OUTPUT--- > > # ./FragmentedSend.py | ./BashReadTest > > Read status 142, value "" > > Read status 142, value "Stat" << the partial read > > FAILED READ: "us: OK" > > Traceback (most recent call last): > > File "./FragmentedSend.py", line 16, in <module> > > os.write(1, nextSendData[0:sendLength]) > > OSError: [Errno 32] Broken pipe > > --- HYPOTHETICAL-OUTPUT--- > > > > Is this consistent with what you would be expecting! > > I get the following with a few runs of the above code against a freshly- > built bash-4.2.39 (x24 is just a script that wraps the pipeline): > > $ ./bash ./x24 > Read status 142, value "" > Read status 142, value "Status:" > Read status 142, value "" > FAILED READ: "OK" > Traceback (most recent call last): > File "./FragmentedSend.py", line 16, in <module> > os.write(1, nextSendData[0:sendLength]) > OSError: [Errno 32] Broken pipe > $ ./bash ./x24 > Read status 142, value "" > Read status 142, value "Statu" > Read status 142, value "s:" > FAILED READ: "OK" > Traceback (most recent call last): > File "./FragmentedSend.py", line 16, in <module> > os.write(1, nextSendData[0:sendLength]) > OSError: [Errno 32] Broken pipe > $ ./bash ./x24 > Read status 142, value "" > Read status 142, value "Status: OK" > FAILED READ: "" > Traceback (most recent call last): > File "./FragmentedSend.py", line 16, in <module> > os.write(1, nextSendData[0:sendLength]) > OSError: [Errno 32] Broken pipe > $ ./bash ./x24 > Read status 142, value "Sta" > Read status 142, value "tus: O" > FAILED READ: "K" > Traceback (most recent call last): > File "./FragmentedSend.py", line 16, in <module> > os.write(1, nextSendData[0:sendLength]) > OSError: [Errno 32] Broken pipe > > I get the same results if I run the pipeline in an interactive shell. > This is pretty much what I expect. The whitespace and newlines will > disappear due to read's $IFS processing if they're first or last in > the string.
OK, so if I understand correctly, following should be true: Referring to my e-mail from Mo 17.12.2012 09:35, it seems that you get the "hypothetical output", which is correct, while the script on my side produces different output. Hence the bash version from Ubuntu (GNU bash, version 4.2.24(1)-release) on my side behaves differently than your bash-4.2.39. I'll try to figure out the commit, that changed the behavior and submit it in a bug-report to Ubuntu, perhaps they will patch. Thanks for your help, Roman