bash – 语法错误:文件结束意外(期待“fi”)

我在bash中写一个makefile,我有一个目标,我试图找到一个文件是否存在,即使我认为语法是正确的,我仍然给我一个错误.

这是我试图运行的脚本

read: 
        if [ -e testFile] ; then \ 
        cat testFile\ 
        fi

我使用的标签,这不是一个问题.

错误是(当我输入:“make read”)

if [ -e testFile] ; then \
        cat testFile \
        fi
/bin/sh: Syntax error: end of file unexpected (expecting "fi")
make: *** [read] Error 2
尝试在cat testFile之后添加分号.例如:
read: 
    if [ -e testFile ] ; then  cat testFile ; fi

或者:

read:
    test -r testFile && cat testFile

相关文章

用的openwrt路由器,家里宽带申请了动态公网ip,为了方便把2...
#!/bin/bashcommand1&command2&wait从Shell脚本并行...
1.先查出MAMP下面集成的PHP版本cd/Applications/MAMP/bin/ph...
1、先输入locale-a,查看一下现在已安装的语言2、若不存在如...
BashPerlTclsyntaxdiff1.进制数表示Languagebinaryoctalhexa...
正常安装了k8s后,使用kubect工具后接的命令不能直接tab补全...