From owner-freebsd-bugs Sun Feb 23 01:00:03 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id BAA29283 for bugs-outgoing; Sun, 23 Feb 1997 01:00:03 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id BAA29258; Sun, 23 Feb 1997 01:00:01 -0800 (PST) Date: Sun, 23 Feb 1997 01:00:01 -0800 (PST) Message-Id: <199702230900.BAA29258@freefall.freebsd.org> To: freebsd-bugs Cc: From: j@uriah.heep.sax.de (J Wunsch) Subject: Re: bin/2803: /bin/sh 'for' statement vs IFS setting problem Reply-To: j@uriah.heep.sax.de (J Wunsch) Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk The following reply was made to PR bin/2803; it has been noted by GNATS. From: j@uriah.heep.sax.de (J Wunsch) To: mpp@freefall.freebsd.org (Mike Pritchard) Cc: FreeBSD-gnats-submit@freefall.freebsd.org, Scott.Blachowicz@seaslug.org Subject: Re: bin/2803: /bin/sh 'for' statement vs IFS setting problem Date: Sun, 23 Feb 1997 09:33:20 +0100 As Mike Pritchard wrote: > > >How-To-Repeat: > > > > I use this test script: > > > > #! /bin/sh > > IFS=' :' > > for tok in a:b:c > > do > > echo $tok > > done > > for tok in d e f > > do > > echo $tok > > done > > > > which SHOULD output 6 lines of output (letters a-f on separate > > lines), but what comes out is this: > > > > a b c > > d > > e > > f > 3) > IFS=' :' > xxx=a:b:C > for tok in $xxx > do > echo $tok > done > > For the record, under 3.0, every shell I tried, ksh, sh and bash > all work this way. Does this work the same way on other operating > systems? E.g. Sunos/Solaris, or some other SYSv variety? $ echo ${.sh.version} Version M-12/28/93e $ for tok in a:b:c > do > echo $tok > done a b c $ That's ksh93, the genuine Korn shell. Since this is `by definition' also the Posix shell, i think we can close the case. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)