- shell脚本if中判断大于、小于、等于、不等于的符号
脚本有问题,有没有哪位大佬能帮忙检查一下?
#!/bin/bash
run_num=`squeue | grep shifting | wc -l`
while true;dofor i in $(seq 2 9);doname=$(printf len300_0%d $i)cd $name || exit 1model_num=$(ls -l *model.pdb 2>/dev/null | wc -l)if [ $(echo "$model_num") -eq 1200 ];thencd ../ || exit 1elif [ $(echo "$model_num") -eq 0 ]&&[ $(echo "$run_num") -le 197 ];thencd Submitnohup python submit.py & cd ../../fidonesleep 300
done
#!/bin/bashwhile true; dofolder_completed=falsefor i in $(seq 2 9); doname=$(printf len300_0%d $i)cd $name || exit 1model_num=$(ls -l *model.pdb 2>/dev/null | wc -l)run_num=$(squeue | grep shifting | wc -l)if [ "$model_num" -eq 1200 ]; thencd ../ || exit 1folder_completed=truebreak elif [ "$model_num" -eq 0 ] && [ "$run_num" -le 197 ]; thencd Submitnohup python submit.py &cd ../../folder_completed=truebreak fidoneif [ "$folder_completed" = true ]; thencontinuefisleep 1800
done