Hello,

I am using mksh on cygwin as delivered / installed by the cygwin setup.
In this kind of configuration it is not possible to execute shell scripts 
with CRLF line endings.
This is due to the fact that in shf.c the scripts are opened as binary:
fd = open(name, oflags | O_BINARY, mode);
If the scripts were to be opened in text mode:
fd = open(name, oflags | O_TEXT, mode);
there would be no more problems whith CRLF scripts.
Would it be viable and acceptable to generally open shell scripts in text 
mode on platforms where this is available as an option?
Out of curiosity: Even with binary open mode it is possible to execute CRLF 
shell scripts using option -c:
mksh -c crlf.sh
Is this intentional or some kind of side effect?

Best regards

Franz


Reply via email to