X-Spam-Check-By: sourceware.org Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: Read not honouring "-r"? Date: Tue, 19 Sep 2006 10:46:46 -0400 Message-ID: <4C89134832705D4D85A6CD2EBF38AE0F7B0E10@PAUMAILU03.ags.agere.com> From: "Williams, Gerald S \(Jerry\)" To: Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id k8JEl3RQ007547 I wrote: > 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. I couldn't resist trying it out on my Linux box, which runs the same version of pdksh as my Cygwin install. Even more interestingly, it works as you were expecting on Linux as well. So this looks like a problem with the Cygwin port of pdksh. This simpler test case demonstrates it pretty clearly: --test.sh-- dos2unix foo.txt while read x; do echo "$x"; done < foo.txt unix2dos foo.txt while read x; do echo "$x"; done < foo.txt --foo.txt-- 1 2 3 ---- Run under various shells: $ sh test.sh # zsh and bash yield same result foo.txt: done. 1 2 3 foo.txt: done. 1 2 3 $ ksh test.sh # this one fails for DOS endings foo.txt: done. 1 2 3 foo.txt: done. 1 $ _ gsw -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/