From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1121 invoked by alias); 6 May 2004 12:40:57 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 1113 invoked from network); 6 May 2004 12:40:55 -0000 Received: from unknown (HELO mail22.messagelabs.com) (62.231.131.211) by sources.redhat.com with SMTP; 6 May 2004 12:40:55 -0000 X-VirusChecked: Checked X-Env-Sender: Kevan.Gelling@euphony.co.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] Received: (qmail 14425 invoked from network); 6 May 2004 12:40:53 -0000 Received: from unallocated.star.net.uk (HELO ecexchange02.euphony.com) (62.173.120.154) by server-14.tower-22.messagelabs.com with SMTP; 6 May 2004 12:40:53 -0000 Message-ID: <201BC46BD93D244AB0A910D1203FFC1904B6A873@ecexchange02.euphony.com> From: Kevan Gelling To: "'cygwin@cygwin.com'" Subject: 1.5.9: Trouble with setting variables using 'read' in a script Date: Thu, 06 May 2004 13:25:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-SW-Source: 2004-05/txt/msg00224.txt.bz2 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