我有一个bash脚本,可以打开一个名为salome shell的shell,它应该在该shell中执行一个名为as_run的命令。问题是,进入salome外壳后,直到我退出salome外壳,它才执行命令。这是我得到的代码:
#!/bin/bash
cd /opt/salome/appli_V2018.0.1_public
./salome shell
eval "as_run /home/students/gbroilo/Desktop/Script/Template_1_2/exportSalome"
为了在salome shell中执行命令,我该怎么办?
可能这就是您想要的:
# call salome shell with commands in a specified script file
cd /opt/salome/appli_V2018.0.1_public
./salome shell <"/home/students/gbroilo/Desktop/Script/Template_1_2/exportSalome"
或者可能是您想要的:
# pipe a command as_run... to salome shell
cd /opt/salome/appli_V2018.0.1_public
echo "as_run /home/students/gbroilo/Desktop/Script/Template_1_2/exportSalome" | ./salome shell
无论如何,您必须阅读salome指南,了解salome shell如何调用它的脚本。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句