我想构建一个shell脚本来执行以下两个命令,但是shell抱怨它不知道参数clean或reload。
make -f '/home/ec2-user/infx/infx.mak' clean
make -f '/home/ec2-user/infx/infx.mak' reload > '/home/ec2-user/infx/mylog.txt' 2>&1
我也想从目录中创建一个变量,但是在尝试连接目录和 infx.mak 时,我遇到了更多问题。
谢谢你的帮助
代码和错误:
echo "Cleaning Project"
make -f '/home/ec2-user/infx/infx.mak' clean
echo "Making Project"
make -f '/home/ec2-user/infx/infx.mak' reload > '/home/ec2-user/infx/mylog.txt' 2>&1
srcdir='/home/ec2-user/infx'
srcmak='/infx.mak'
echo "$srcmak$srcdir"
exit 0
[ec2-user@ip infx]$ sudo ./reload.sh
'. Stop. No rule to make target `clean
: ambiguous redirect 1
/home/ec2-user/infx