【发布时间】:2015-11-05 04:25:10
【问题描述】:
是否可以使用行数来打破 bash 中的 while 循环?
我有以下代码,但它不会中断并无限运行:
wc -l Database.faa > counter
perl -p -e 's/ /\t/g' counter | cut -f6 > temp; mv temp counter
while
($counter > '0')
do
# some commands
wc -l Database.faa > counter
perl -p -e 's/ /\t/g' counter | cut -f6 > temp; mv temp counter
done
我的程序每次运行都会减少 Database.faa,但是当 Database.faa 为空时,它会继续运行。有人可以帮忙吗?
谢谢。
【问题讨论】:
-
请缩进一点,向我们展示您的研究成果。这么小的sn-p问题太多了。
-
这就是你的意思吗,HuStmpHrrr? :)
标签: bash while-loop conditional-statements