跑shell脚本出错问题以及解决。

Posted 北漂-boy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了跑shell脚本出错问题以及解决。相关的知识,希望对你有一定的参考价值。

脚本信息:

#!/bin/bash
function hello(){
cat <<YJT
  echo "hello world!!!"
YJT 
}
hello 

错误:

test.sh: line 7: warning: here-document at line 3 delimited by end-of-file (wanted `YJT‘)
test.sh: line 8: syntax error: unexpected end of file

解决:

        是由于在末尾的YJT后面有空格导致的,YJT这个结束符的前面都不应该有空格,否则就会报错。

 


以上是关于跑shell脚本出错问题以及解决。的主要内容,如果未能解决你的问题,请参考以下文章