delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/05/06/10:22:17

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Reply-To: <Jan DOT Schormann AT BrainLAB DOT com>
From: "Jan Schormann" <Jan DOT Schormann AT BrainLAB DOT com>
To: <cygwin AT cygwin DOT com>
Subject: cont'd - RE: 1.5.9: Trouble with setting variables using 'read' in a script
Date: Thu, 6 May 2004 16:21:26 +0200
Message-ID: <KCEOLMMHICICJKHPFOALIEFPCDAA.Jan.Schormann@BrainLAB.com>
MIME-Version: 1.0
In-Reply-To: <201BC46BD93D244AB0A910D1203FFC1904B6A873@ecexchange02.euphony.com>
X-OriginalArrivalTime: 06 May 2004 14:21:26.0472 (UTC) FILETIME=[6A883C80:01C43375]
X-Spam-Status: No, hits=-105.2 required=5.5 tests=BAYES_10,IN_REP_TO,MSGID_GOOD_EXCHANGE,USER_IN_WHITELIST version=2.55
X-Spam-Level:
X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)
X-IsSubscribed: yes

(Please excuse the unfinished last mail, I hit "Ctrl-Enter"
by accident.)

>   - echo "text" | read var ; echo $var
>   - cat file | read var ; echo $var
>   - read var < file | echo $var

.. continuing from last time, all of these won't work
because you're always creating a new subshell.

Try

  read var < file ; echo $var

Cheers,
	Jan.



--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019