a=$(cat 1.sh)
等价于a=`cat 1.sh`而a=(cat 1.sh) 相当于定义一个a数组,内容为cat 1.sha=(`cat 1.sh`)相当于把1.sh里面的内容当成a的数组,a仍旧是一个数组a=$(`cat 1.sh`)此命令会报错,不能执行
[root@zejin240 chenzejin]# cat 1.sh hello world 2016 better [root@zejin240 chenzejin]# a=(cat 1.sh)[root@zejin240 chenzejin]# b=(`cat 1.sh`)[root@zejin240 chenzejin]# c=$(cat 1.sh)[root@zejin240 chenzejin]# d=`cat 1.sh` [root@zejin240 chenzejin]# echo ${a[@]}cat 1.sh[root@zejin240 chenzejin]# echo ${b[@]}hello world 2016 better[root@zejin240 chenzejin]# echo ${c[@]}hello world 2016 better[root@zejin240 chenzejin]# echo ${d[@]}hello world 2016 better [root@zejin240 chenzejin]# echo $acat[root@zejin240 chenzejin]# echo $bhello[root@zejin240 chenzejin]# echo $chello world 2016 better[root@zejin240 chenzejin]# echo $dhello world 2016 better [root@zejin240 chenzejin]# e=$(`cat 1.sh`) -bash: hello: command not found