更好地引用在shell脚本上执行命令

rog*_*gcg 1 linux shell

我对差异有疑问,哪一个是在shell脚本中执行命令的更好的引用.

例如,我有两个例子:

echo "The name of the computer is `uname -n`"
echo "The name of the computer is $(uname -n)"
Run Code Online (Sandbox Code Playgroud)

哪一个更好?或者没有区别?

Jul*_*ano 7

$(...)一般建议之一,因为它更容易筑巢.相比:

date -d "1970-01-01 $(echo "$(date +%s)-3600"|bc) sec UTC"

date -d "1970-01-01 `echo \"\`date +%s\`-3600\"|bc` sec UTC "
Run Code Online (Sandbox Code Playgroud)