要将命令的输出存储为sh/ksh/bash中的变量,您可以执行任一操作
var=$(command)
要么
var=`command`
两种方法之间有什么区别?
bash shell ksh sh
bash ×1
ksh ×1
sh ×1
shell ×1