并行启动 Shell 脚本的多个实例

并行启动 Shell 脚本的多个实例

我有一个父文件夹其中包含一个脚本我的测试用例

 Parent_folder/mytestcase.sh

我想在复制 5 次父文件夹并从其文件夹目录启动 mytestcase.sh 后启动 5 个终端实例以同时从 5 个不同的终端运行 mytestcase.sh。我复制文件夹 5 次的原因是因为脚本打开并写入多个文件,而我不希望多个脚本写入同一个文件。

前任:

Terminal1 : Copy Parent folder and launch: Parent_folder_copy1/mytestcase.sh
Terminal2 : Copy Parent folder and launch: Parent_folder_copy2/mytestcase.sh
Terminal3 : Copy Parent folder and launch: Parent_folder_copy3/mytestcase.sh
Terminal4 : Copy Parent folder and launch: Parent_folder_copy4/mytestcase.sh
Terminal5 : Copy Parent folder and launch: Parent_folder_copy5/mytestcase.sh

如何通过 shell 脚本实现这一点?

相关内容