Linux下运行高斯Gaussian 03的命令
只在后台运行并输出为test.log文件:
g03 test.gjf &
g03 < test.gjf |tee test.out
g03 < test.gjf >test.out &
在Linux中对当前目录下所有Gaussian gjf输入文件用g03进行批处理
在 Linux中批处理运行Gaussian 03的shell脚本如下:
#!/bin/bash
for inf in *.gjf
do
outf=`echo ${inf}|tr "gjf" "out"`
g03 < ${inf} > ${outf}
done
作用:把当前目录下所有的gjf文件用g03 计算,文件扩展名自动改为out。
上述脚本解析
#!/bin/bash
for inf in *.gjf
do
… …
Done
outf=`echo ${inf}|tr"gjf" "out"`
echo ${inf}: 显示inf 的值,此处在每次循环时候为某一个*.gjf 的文件名
echo ${inf}|tr "gjf""out" : 把inf 替换为out,为同windows 下的g03兼容,用out做后缀
outf=`echo ${inf}|tr "gjf""out"` :给outf 赋值
g03 < ${inf} >${outf}
g03进行批处理gjf文件脚本的使用方法
1.将脚本文件另存为batch_g03.sh,然后用chmod命令给它加上可执行权限:
chmod u+x batch_g03.sh
2.把批处理脚本文件放到一个PATH 包含的路径下面(如g03目录下)
3.从终端进入存放gjf输入文件的目录,然后输入“batch_g03.sh &”即可依次计算改目录下的所有gjf 文件。
4.最后输入 exit命令关闭终端即可。
注:也可以直接batch_g03.sh批处理脚本直接放到gjf文件所在目录里面,然后输入./batch_g03.sh亦可执行批处理。
以下版权声明必须遵守,转载时必须以链接的形式注明如下信息:
原载于 散人笔记
原文地址 http://www.eryi.org/blog/post/run-gaussian-cpu-memory.html