I agree with Ahmed and RavinderSingh13 I had a similar problem and found that a white space was just before "#!/bin/bash" at the first line of some of my scripts. I never understood how this space appeared but all my script has at least one space at beginning of any line