delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/08/18/09:15:46

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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
From: "Hannu E K Nevalainen" <_garbage_collector_ AT telia DOT com>
To: <cygwin AT cygwin DOT com>
Subject: RE: read command available?
Date: Wed, 18 Aug 2004 15:14:27 +0200
Message-ID: <NGBBLLIAMFLGJEOAJCCECEBLDNAA._garbage_collector_@telia.com>
MIME-Version: 1.0
In-Reply-To: <20040818123502.84272.qmail@web60405.mail.yahoo.com>
X-IsSubscribed: yes

"neal somos" wrote:
> The read command is supposedly a shell builtin.
>
> Strangely enough, the first time I tried the
> example given with ksh, I got the exact same response.
>
> However on later attempts, I got what was expected.
> I find this odd.
>
> /bin/sh and bash both handle this just fine.
> I can't speak for ksh, but maybe its time to
> switch to a different shell?
>
> neal

This really is OT on this list, but as we've started...

 You have to be aware of some automatic optimizations, I'm not sure about
ksh - but bash does some subshell'ing in this situation. The following DOES
indicate that ksh shouldn't, but then you never know how up to date the man
page is.

-- man ksh excerpt --
Note: Some shells (but not this one) execute control structure commands
in a subshell when one or more of  their  file  descriptors  are  redi-
rected,  so  any  environment  changes  inside  them  may  fail.  To be
portable, the exec statement should be used instead  to  redirect  file
descriptors before the control structure.

-- and right after it --
( list )
       Execute list in a subshell.  There is no implicit  way  to  pass
       environment changes from a subshell back to its parent.


/Hannu E K Nevalainen, B.Sc. EE - 59+16.37'N, 17+12.60'E         --72-->

** mailing list preference; please keep replies on list **

-- printf("LocalTime: UTC+%02d\n",(DST)? 2:1); --
--END OF MESSAGE--


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