bug-bash
[Top][All Lists]
Advanced

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

Re: Re: [here string] uncompatible change on here string function


From: Greg Wooledge
Subject: Re: Re: [here string] uncompatible change on here string function
Date: Mon, 27 Nov 2017 08:23:36 -0500
User-agent: NeoMutt/20170113 (1.7.2)

On Fri, Nov 24, 2017 at 11:22:56AM +0800, 尹剑虹 wrote:
> It's not the point. the problem is bash-4.4 auto add quote around  $var or 
> $(cmd)  after '<<<'
> 
> On bash-4.2 and before  following command always works fine
>   read ignore fstype <<<$(df --output=fstype $mountpoint)
> 
> But after Update bash-4.4, our customer's script get fail, do you understand 
> what I mean?

The script is broken.  It happened to work in bash 4.2 because of a bug
in bash 4.2 that cancelled out the bug in the script.

wooledg:~$ df --output=fstype /
Type
ext4

Here is how the script should be written:

{ read; read -r fstype; } < <(df --output=fstype "$mountpoint")

And testing it:

wooledg:~$ mountpoint=/
wooledg:~$ { read; read -r fstype; } < <(df --output=fstype "$mountpoint")
wooledg:~$ declare -p fstype
declare -- fstype="ext4"



reply via email to

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