我正在运行下面的循环,这个循环应该在后台的服务器上同时运行几个进程:
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] 1000
[2] 2000
[3] 3000
[4] 4000
[5] 5000 [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'当我使用ps或top查看进程时,没有进程。
这个脚本需要运行至少一个小时,并且我没有得到它需要产生的结果。
有没有人知道出了什么问题?
发布于 2012-06-21 06:42:42
在命令中使用$i和$n,而不是i和n,如下所示:
matlab -nojvm -r "pth=path(/myfold);addpath(pth);script1;pause(1);func1($i,$n);clear;exit" </dev/null &https://stackoverflow.com/questions/10792708
复制相似问题