为什么这个bash脚本一遍又一遍地运行?

时间:2016-12-12 23:43:24

标签: bash shell scripting

这个剧本不知何故被困在一个循环中,它一遍又一遍地开始。

这是脚本。

#!/bin/bash
# usage  decimator.sh "$1" "$2"
echo $1
echo $2
bin/decimator.sh --pdfinfile "$1" --outdir scr --tldr "$2"

这是它开始的历史。

 1997  ../test/decimator-test.sh ../test/data/Altmetrics_for_LibrariansAltmetric.pdf "dumbing down Altmetrics"
 1998  git pull
 1999  lart ~/pagekicker-community/test/data/
 2000  cp ../test/data/Altmetrics_for_LibrariansAltmetric.pdf ~/pagekicker-community/test/data .
 2001  cp ../test/data/Altmetrics_for_LibrariansAltmetric.pdf ~/pagekicker-community/test/data/.
 2002  ../test/decimator-test.sh ../test/data/Altmetrics_for_LibrariansAltmetric.pdf "dumbing down Altmetrics"
 2003  ../test/decimator-test.sh ../test/data/Altmetrics_for_LibrariansAltmetric.pdf "dumbing down Altmetrics"
 2004  ../test/decimator-test.sh ../test/data/Altmetrics_for_LibrariansAltmetric.pdf "dumbing down Altmetrics"
 2005  ../test/decimator-test.sh ../test/data/Altmetrics_for_LibrariansAltmetric.pdf "dumbing down Altmetrics"
 2006  ../test/decimator-test.sh ../test/data/Altmetrics_for_LibrariansAltmetric.pdf "dumbing down Altmetrics"
 2007  ../test/decimator-test.sh ../test/data/Altmetrics_for_LibrariansAltmetric.pdf "dumbing down Altmetrics"
 2008  ../test/decimator-test.sh ../test/data/Altmetrics_for_LibrariansAltmetric.pdf "dumbing down Altmetrics"
 2009  ../test/decimator-test.sh ../test/data/Altmetrics_for_LibrariansAltmetric.pdf "dumbing down Altmetrics"
 2010  ../test/decimator-test.sh ../test/data/Altmetrics_for_LibrariansAltmetric.pdf "dumbing down Altmetrics"
 2011  ../test/decimator-test.sh ../test/data/Altmetrics_for_LibrariansAltmetric.pdf "dumbing down Altmetrics"
 2012  ../test/decimator-test.sh ../test/data/Altmetrics_for_LibrariansAltmetric.pdf "dumbing down Altmetrics"

我做了系统重启,我做了ps aux | grep test以查看进程是否存在。没有快乐。

它仍在这样做,后来有一千条历史......

1 个答案:

答案 0 :(得分:1)

在推断问题似乎是历史记录在循环中进入命令行并找到this

之后

我跑了:

history -c
history -w

解决了这个问题。我仍然不确定它是如何开始的。

相关问题