[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bash-5.1-beta available
From: |
felix |
Subject: |
Re: Bash-5.1-beta available |
Date: |
Wed, 23 Sep 2020 09:12:26 +0200 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
Hi,
On Mon, Sep 21, 2020 at 09:13:13PM -0400, Dale R. Worley wrote:
> Andreas Schwab <schwab@linux-m68k.org> writes:
> I assume that if you really want the old effect, you can still do
>
> exec {dup}<&1
You mean:
exec {dup}<&0
>
> ... <( ... <$dup ) ...
and:
... <( ... <&$dup ) ...
>
> exec {dup}<&-
>
> Dale
Sample:
This worked under previous bash versions (I use 5.0.3(1)-release):
testForkInput () {
local line
while read line ;do
echo "$line"
done < <(
sed 's/^/> /'
)
}
But with 5.1.0(1)-beta, I have to replace this with:
testForkInput () {
local dup line
exec {dup}<&0
while read line ;do
echo "$line"
done < <(
sed 's/^/> /' <&$dup
)
exec {dup}>&-
}
testForkInput < <(seq 1 5)
> 1
> 2
> 3
> 4
> 5
On Tue, Sep 22, 2020 at 08:57:57AM +0200, Andreas Schwab wrote:
> That point is that it silently breaks existing scripts.
I agree.
--
Félix Hauri - <felix@f-hauri.ch> - http://www.f-hauri.ch
- Bash-5.1-beta available, Chet Ramey, 2020/09/10
- Re: Bash-5.1-beta available, Andreas Schwab, 2020/09/13
- Re: Bash-5.1-beta available, Robert Elz, 2020/09/13
- Re: Bash-5.1-beta available, Chet Ramey, 2020/09/14
- Re: Bash-5.1-beta available, Robert Elz, 2020/09/14
- Re: Bash-5.1-beta available, Chet Ramey, 2020/09/15
- Re: Bash-5.1-beta available, Robert Elz, 2020/09/15
- Re: Bash-5.1-beta available, Chet Ramey, 2020/09/16