3

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.

Indrajeet Gour
  • 4,020
  • 5
  • 43
  • 70

2 Answers2

6

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.

choroba
  • 231,213
  • 25
  • 204
  • 289
-3

Please don't use bash -o igncr or set -o igncr in modern cygwin bash >= 3.2.

You can pass global env SHELLOPTS=igncr before executing your script and forget about carriage return issues.

Read more information about igncr absurd in cygwin bash.

puchu
  • 3,294
  • 6
  • 38
  • 62