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 X-VirusChecked: Checked X-Env-Sender: Kevan DOT Gelling AT euphony DOT co DOT uk X-Msg-Ref: server-14.tower-22.messagelabs.com!1083847253!8451015 X-StarScan-Version: 5.2.10; banners=euphony.co.uk,-,- X-Originating-IP: [62.173.120.154] Message-ID: <201BC46BD93D244AB0A910D1203FFC1904B6A873@ecexchange02.euphony.com> From: Kevan Gelling To: "'cygwin AT cygwin DOT com'" Subject: 1.5.9: Trouble with setting variables using 'read' in a script Date: Thu, 6 May 2004 13:40:51 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Note-from-DJ: This may be spam I'm having trouble setting variables using the 'read' command in bash. All of the following lines fail to set $var and return a blank line. - echo "text" | read var ; echo $var - cat file | read var ; echo $var - read var < file | echo $var I can get it work by explicitly declaring the file descriptor with the file redirection, but I'd prefer to use a pipe. - read -u 0 var