日期:2014-05-16  浏览次数:20661 次

这个命令的含义是什么?
out=$(cat text.txt)
echo $out

结果是1 2 3 4 5 6 7 8
因为文件text.txt是有这些数字的。
我想问下$(cat text.txt)表示什么意思?我就知道linux中变量前面需要用$符号的,但是,(cat text.txt)不表示变量呀

------解决方案--------------------
http://blog.csdn.net/csu_whm/article/details/4586014
是命令替换啦,

    老式语法`subcommand`

     新式语法 $(subcommand)
------解决方案--------------------
Command Substitution
http://www.tldp.org/LDP/abs/html/commandsub.html