1

我刚刚开始学习 bash 脚本,我尝试编写简单的脚本来通过 cmake 从源代码创建一个项目,然后制作它。这是脚本的文本:

#!/usr/bin/env bash
mkdir -p cmake
cd ./cmake
exec cmake ../
exec make

但是通过cmake创建项目后,脚本什么也不做。没有脚本项目成功构建。可能有人知道是什么问题吗?

4

1 回答 1

5

exec is "Instead of the rest of the script, execute this command". Remove them both:

# ...as before...
cmake ../
make
于 2013-06-18T11:11:37.360 回答