我写过小bash来自动化我的代码
#!/bin/bash
jhome () {
cd /home/milenko/OCCAM2DMT_V3.0/cifort
}
./Occam2D start.txt
exe文件是Occam2d,输入文件是start.txt。 当我运行我的脚本时,我得到了
bash a.sh
a.sh: line 6: ./Occam2D: No such file or directory
为什么?
答案 0 :(得分:2)
@ anubhava的评论:
#!/bin/bash
jhome () {
cd /home/milenko/OCCAM2DMT_V3.0/cifort
}
# call your function to change directory
# and only if cd was successful run ./Occam2D
jhome && ./Occam2D start.txt