Text File Busy/Unexpected End of File Error in Bash

Sometimes, we get an error when we paste some bash code from windows environment to linux terminal. The error is like text file busy, or bash uninterrpreted error, Unexpected End of File etc. etc.

So, the poblem is, either the file is not writeable. 
So, chmod 777 filename

or 

the linux terminal is not able to read the input file.
So, run the dos2unix command
$ dos2unix filename.sh

And then run the bashscript
$ ./filename.sh

0 comments:

Post a Comment