From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3/2) with ESMTP id AAA21941 for ; Sat, 22 Jun 1996 00:42:21 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id KAA01010; Fri, 21 Jun 1996 10:30:31 -0400 (EDT) Resent-Date: Fri, 21 Jun 1996 10:30:31 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199606211430.QAA03714@bolyai.cs.elte.hu> Subject: Re: quoting bug To: A.Main@dcs.warwick.ac.uk (Zefram) Date: Fri, 21 Jun 1996 16:30:08 +0200 (MET DST) Cc: stephens@math.ruu.nl, zsh-workers@math.gatech.edu In-Reply-To: <6066.199606211417@stone.dcs.warwick.ac.uk> from Zefram at "Jun 21, 96 03:17:10 pm" Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368 X-Mailer: ELM [version 2.4ME+ PL16 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"gWwTo2.0.iF.68hon"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1407 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > >> setopt SH_WORD_SPLIT > > > >What does POSIX say? > > POSIX requires the SH_WORD_SPLIT behaviour. It also requires field > splitting in normal words, as well as the result of expansions: > > % setopt SH_WORD_SPLIT > % IFS=x > % echo fooxbar > fooxbar No. POSIX does not allow field splitting here: "IFS is used for performing field splitting on the results of parameter and command substitution; it is not used for splitting all fields. Previous versions of the shell used it for splitting all fields during field splitting, but this has severe problems because the shell can no longer parse its own script. There are also important security implications caused by this behavior. All useful applications of IFS use it for parsing input of the read utility and for splitting the results of parameter and command substitution. New versions of the shell have fixed this bug, and POSIX.2 requires the corrected behavior." > I think we should implement this behaviour -- when SH_WORD_SPLIT is > set, of course. It should be very easy. I also think we should retain > the current default, as it's much nicer behaviour. Yes, it can be implemented easily by adding IBLANK type to IFS elements but I still think that it is unnecessary. And there may be hidden problems as this change affects the parser. Zoltan