Read not honouring "-r"?

Williams, Gerald S (Jerry)
Tue Sep 19 13:54:00 GMT 2006

Doug Irwin wrote:
> One would expect a "read -r fs t2 t3" to process this without
> attempting to expand slashes.  But I can't seem to get this bit
> working... And I can't seem to find any doco on doing that in Cygwin.
> I've attached the files I am testing with in the hope that someone
> can help me work this out. 
> No doubt I have missed something rather obvious.

"-r" has nothing to do with it: CR/LF line endings are the

This seems to be particularly tied to ksh, and specifically
when you use "<" to redirect a file. If you simply pipe the
output of grep to the while loop, it works. Interestingly,
sh, bash, and zsh all give the behavior you were expecting.

So for the short term, run d2u on filesystems.cfg. If you
plan to continue using ksh, you may want to follow up and
try to understand the discrepancy--there may be an option
that allows you to get the behavior you want (and if not,
it may be worth having KSH's behavior changed to be more
consistent with other shells, but that's something for
the maintainer and/or upstream KSH support to decide).


Unsubscribe info:
Problem reports:

More information about the Cygwin mailing list