Thanks all. Now I got it: The point is the action on bash-4.2 and before deosn't match the action on ksh and zsh.
Jianhong 发自网易邮箱手机版 在2017年11月27日 23:42,Vladimir Marek 写道: > > 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