[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 5.1 regression?
From: |
Greg Wooledge |
Subject: |
Re: 5.1 regression? |
Date: |
Mon, 1 Aug 2022 07:10:13 -0400 |
On Mon, Aug 01, 2022 at 04:37:18PM +0900, Dominique Martinet wrote:
> Harald Dunkel wrote on Mon, Aug 01, 2022 at 09:08:40AM +0200:
> > a colleague pointed me to a changed behavior of bash 5.1.4 in Debian 11.
> > ----
> > #! /bin/bash
> > # set -x
> >
> > insert()
> > {
> > local data="$1"
> > local lineNumber="$2"
> >
> > head -n "$lineNumber"
>
> The problem is that stdin is eaten up by this head command.
>
> What changed is that bash used to store stdin input in a temporary file,
> so head could seek back to the actual position in the stream after the
> first three lines but that no longer works:
Specifically, this part of the bash 5.1 changelog:
c. Here documents and here strings now use pipes for the expanded document if
it's smaller than the pipe buffer size, reverting to temporary files if it's
larger.