如果你已准备好perl脚本(在windows中),从命令行运行它100次的最佳方法是说并收集它产生的数据?

use*_*359 1 perl command-line batch-file command-prompt

我在Windows中编写了一个perl脚本,它生成一行或两行输出.

我希望能够从命令行运行脚本n = 100次而不在脚本中进行更多编码(除非有一种简单的方法)并收集输出?我有人建议批处理文件可能有序吗?

基本上,有一种简单的方法:

[perl script.pl >> output + [Enter Key]] # n times in cmd

谢谢!

Joh*_*hnB 5

您可以在批处理文件中使用FOR循环:

for /L %%N IN (1, 1, 100) DO perl script.pl >> output.txt
Run Code Online (Sandbox Code Playgroud)