我在bash中编写一个makefile,我有一个目标,在其中尝试查找文件是否存在,即使我认为语法正确,我仍然给我一个错误。语法错误:文件意外结束(期待“fi”)
这里是我想
read:
if [ -e testFile] ; then \
cat testFile\
fi
我使用的标签,这样是不是有问题来运行该脚本。
错误的是(当我键入: “让阅读”)
if [ -e testFile] ; then \
cat testFile \
fi
/bin/sh: Syntax error: end of file unexpected (expecting "fi")
make: *** [read] Error 2
备用解决方案的工作原理,但我必须使用if..then语法。添加分号似乎不能解决问题。 – Jaelebi 2009-04-19 06:09:25
奇怪。我第一次用分号尝试它,它没有工作。第二次运行它,它工作。谢谢 – Jaelebi 2009-04-19 06:14:08