0

我正在运行以下循环,该循环应该在后台的服务器上同时运行多个进程:

for ((i = 1; i <= n; i++)); do

matlab -nojvm -r "pth=path(/myfold);addpath(pth);script1;pause(1);func1(i,n);clear;exit" </dev/null &

done

后台命令未暂停(tnx Dennis Williamson),但我得到的结果是:

1.注解:

 [1] 1000
 [2] 2000
 [3] 3000
 [4] 4000
 [5] 5000

2. matlab nojvm txt

 [1]   Done       'name of the above command'
 [2]   Done       'name of the above command'
 [3]   Done       'name of the above command'
 [4]-  Done       'name of the above command'
 [5]+  Done       'name of the above command'

当我使用pstop查看进程时,没有。

该脚本需要运行至少一个小时,但我没有得到它需要产生的结果。
有谁知道出了什么问题?

4

1 回答 1

0

在命令中使用$i$n而不是in,如:

matlab -nojvm -r "pth=path(/myfold);addpath(pth);script1;pause(1);func1($i,$n);clear;exit" </dev/null &
于 2012-06-20T22:42:42.380 回答