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.
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.
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.
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.