Search code examples
cygwin

Cygwin: why we required "export SHELLOPTS; set -o igncr"


When I tried running my shell script earlier it said end of file error. But after running the following two commands it started running fine.

export SHELLOPTS 
set -o igncr

please explain what is the reason behind this.


Solution

  • set -o igncr causes the shell ignore windows line endings (skip \r). Another solution would be to fix the script by running dos2unix on it.