在shell编程中,$(命令)和‘Command’之间有什么区别?要将命令的输出存储为sh/ksh/bash中的变量,可以执行以下操作var=$(command)或var=`command`这两种方法有什么区别?
3 回答

红糖糍粑
TA贡献1815条经验 获得超6个赞
$()
$()
$(echo foo$(echo bar))

万千封印
TA贡献1891条经验 获得超3个赞
$()
``
:
listing=$(ls -l $(cat filenames.txt))
listing=`ls -l \`cat filenames.txt\``

回首忆惘然
TA贡献1847条经验 获得超11个赞
$(command)
`echo \`foo\``
$(echo $(foo))
添加回答
举报
0/150
提交
取消