【发布时间】:2013-11-27 09:01:02
【问题描述】:
这是用于记录 sipp 输出的 shell 脚本,如网站 http://sipp.sourceforge.net/doc/faq.html 所示
我以前从未编写过批处理脚本,我很难理解如何转换此代码以使其在 Windows 中运行。
cat run.sh
#!/bin/sh
>results.txt
for i in $*
do
echo Launching test $i >> results.txt
./sipp -sf $i -m 1 127.0.0.1
if test $? -ne 0
then
echo Test $i failed >> results.txt
else
echo Test $i succeeded >> results.txt
fi
done
exit 0
有人可以帮助我吗?此外,for 循环中的 $* 表示什么?
我批量尝试了 if 条件IF %test NEQ 0 的等效项,但出现语法错误。
【问题讨论】:
-
我可能应该在输入答案之前先输入评论 - 但如果您能准确说明您卡在哪些部分以及您尝试了什么,您可能会得到更好的帮助。
标签: shell batch-file sip