linux命令执行顺序管理
Posted sunnyamy
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux命令执行顺序管理相关的知识,希望对你有一定的参考价值。
bi.sh文件内容如下:
#!/bin/bash date1=$1 round=$2 if [ "$date1" == "" ];then date1=$(date "+%Y%m%d") fi if [ "$round" == "" ];then round=6 fi pro=`ps aux | grep test.sh | awk ‘END{print NR}‘` while(($pro > 1)) do `echo "$date1 sleep!" >> res.txt` sleep 5 pro=`ps aux | grep test.sh | awk ‘END{print NR}‘` done `echo "$date1 is running!" >> res.txt` `sh test.sh $date1 $round`
test.sh文件内容如下:
#!/bin/bash date=$1 i=1 while(( $i<=$2 )) do `echo "$i:hello" >> res.txt` sleep 5 let "i++" done
以上是关于linux命令执行顺序管理的主要内容,如果未能解决你的问题,请参考以下文章