X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Mail-Followup-To: cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com From: Gary Subject: Shell script - is this expected behaviour? Date: Tue, 29 Nov 2011 10:00:46 +0100 Lines: 28 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (cygwin) X-No-Archive: Yes Mail-Copies-To: never X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 If I have a shell script which reads a file which does not have an end of line character at the end if it's only line, it does not read anything. For example: ,---- | #!/bin/sh | | fileName="test.xml" | retVal="Z" | | exec 10<&0 | exec < $fileName | while read configLine | do | retVal="A" | done | exec 0<&10 10<&- | | echo $retVal | | exit 0 `---- If it's expected behaviour, what's the workaround? -- Gary Please do NOT send me 'courtesy' replies off-list. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple