管道符是fork子进程,子进程的变量无法传回父进程
[root@XM-v106 ~]# echo "1 2 3" | read a b c;echo $a [root@XM-v106 ~]# echo "1 2 3" | { read a b c;echo $a; } 1
read放到前面来
[root@XM-v130 ~]# read a b c <<< "1 2 3"