Skip to content
On this page

bash脚本_命令置换符


标签:linux/bash脚本  
  • 从命令输出获取变量值
  • 方法如下:
bash
`ls`
$(ls)

例子:

bash
a=$(ls ~)
echo $a

可以通过 $*$@ 获取所有,不包括文件

Last updated: