in bash script unexpected “syntax error: unexpected end of file” on if statement [duplicate]
- 阅读更多 关于 in bash script unexpected “syntax error: unexpected end of file” on if statement [duplicate]
问题 This question already has answers here : Bash syntax error: unexpected end of file (17 answers) Closed 3 years ago . W/hen i run the following code snippet #!/bin/bash if [ "foo" = "foo" ]; then echo "true" else echo "false" fi echo "end" i get sfm_write_buffer_test.sh: line 9: syntax error: unexpected end of file this doesn't make any sense. echo statements works fine, but when the if statement is encountered it gives the above mentioned error. 回答1: You're on Cygwin, right? As I said in a