Linux shell 编程基础
- 将命令输出存储到变量中的语法是
diff_result=$(diff stc_compile_multifile_withso_build.log stc_compile_multifile_build.txt | wc -l)
keyword_num=$(grep -o 'OFFLOAD' stcc_out_result0.txt| wc -l)
- 条件判断
keyword_num=$(($keyword_num1+$keyword_num2))
if [ $diff_result == 0 ] && [ $keyword_num == 3 ]
then
echo "stc_compile_multifile_withso_build result Passed."
rm -rf stc_compile_multifile_withso_build.log
else
echo "stc_compile_multifile_withso_build result Failed."
mv stc_compile_multifile_withso_
http://home.ustc.edu.cn/~xie1993/linux/linux-shell-func.html