bug-bash
[Top][All Lists]
Advanced

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

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


From: Vladimir Marek
Subject: Re: [here string] uncompatible change on here string function
Date: Mon, 27 Nov 2017 16:42:48 +0100
User-agent: Mutt/1.5.22.1-rc1 (2013-10-16)

> > 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"

Or even
fstype=$( stat --file-system --print "%T\n" "$mountpoint" )

-- 
        Vlad



reply via email to

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