Unable to source a simple bash script
问题 I understand similar questions to this been asked in SO multiple times. However, I couldn't find any usual suspects here. #!/bin/bash myvar="test" if [ "$myvar" == "test" ] then echo "Test mode" fi Spent quite some time on it. Can anyone advice what am I missing? I am able to execute the script, but couldn't source the same. error while source bash: test.sh: line 7: syntax error: unexpected end of file $ which bash /bin/bash $ bash --version 3.2.57(1) I am able to get the same working on my