Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 java 应用程序(串行代码),我想使用 linux 终端循环运行它 100 次。稍后我想收集程序产生的结果。
如何在循环中运行它?
您可以创建一个 shell 脚本并使用终端运行它
#!/bin/bash max=10 for i in `seq 2 $max` do java -jar path/to/jar/file.jar done