bash获取命令输出内容 一维或多维 zhiqiuyuan toollinux tool linux 发布于:Sep 1, 2022 一维 line=`cat syntest.sh | wc -l` echo $line 多维:返回数组 fnames=`ls testcase/functional | grep .sy` for fname in ${fnames[@]} do echo $fname done 更新于:Dec 10, 2022 linux bash linux bash bash变量计数加一 i=1 # in loop body i=`expr $i + 1` bash条件判断命令执行返回值 if diff test.sh syntest.sh > tmpout; then # diff比较如果相同则返回0,则会if条件成立走上面的分支 echo "same....