我创建了一个批处理文件,该文件生成文件列表输出到文本文件,然后在浏览器中显示该文本文件。由于列表需要一段时间才能生成,因此我希望在处理过程中显示一个消息框(理想情况下,另一个消息框在末尾显示,表明该过程已完成),然后显示给浏览器。
答案 0 :(得分:0)
在脚本的开头和脚本的末尾放置一行。
'echo“Entry”' 'echo'退出''
将输出发送到更新的日志文件。这将根据您的语言而有所不同,但相当容易。
作为一个单独的进程,为Enrty和Exit创建一个if语句。在Bash中它将是:
grep_output=`grep Entry <file>`
if [ "$grep_output" == "" ]; then
entryoutput=true;
else
entryoutput=false;
fi
grep_output=`grep Exit <file>`
if [ "$grep_output" == "" ]; then
exitoutput=true;
else
exitoutput=false;
fi
while :; do
if $entryoutput=true and exitoutput=false; then
sleep 10
done
上述语句中的两个条件的语法不是100%。