大多数shell实现了一种将命令作为参数传递的方式,例如
dash -c 'x=1 ; echo $x'
您需要查阅shell手册,以查看是否可行。
您还可以尝试将命令发送到Shell的标准输入:
echo 'set x = 1 ; echo $x' | tcsh
在使用复杂命令的情况下,使用HERE文档可能会更具可读性:
tcsh << 'TCSH'
set x = 1
echo $x
TCSH
,
这可能就是您想要的:
# 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如何调用其脚本。
本文链接:https://www.f2er.com/3100849.html