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 AAA21925 for ; Sat, 22 Jun 1996 00:42:06 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id KAA00901; Fri, 21 Jun 1996 10:26:11 -0400 (EDT) Resent-Date: Fri, 21 Jun 1996 10:26:11 -0400 (EDT) Date: Fri, 21 Jun 1996 16:24:59 +0200 Message-ID: <199606211424.QAA04218@bommel.math.ruu.nl> From: Bruce Stephens To: zsh-workers@math.gatech.edu In-reply-to: Zoltan Hidvegi's message of Fri, 21 Jun 1996 16:03:50 +0200 (MET DST) Subject: Re: quoting bug, and comparisons with ksh93 References: <199606211355.PAA03147@bommel.math.ruu.nl> <199606211403.QAA03198@bolyai.cs.elte.hu> Resent-Message-ID: <"9QgY61.0._D.24hon"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1406 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu >>>>> "Zoltan" == Zoltan Hidvegi writes: >> >>>>> "Zefram" == Zefram writes: >> >> > setopt SH_WORD_SPLIT >> >> What does POSIX say? > Zsh must be invoked as sh/ksh if you want POSIX. Even is sh/ksh > mode there are some minor incompatibilities between zsh and POSIX > but these rarely cause problems. Also the zsh documentation does > not claim that zsh conforms to POSIX. On my computer /bin/sh is a > link to zsh and it works fine. That sounds fine then. It would be a shame to have SH_WORD_SPLIT be the default: the current position is more logical, even if it does sometimes fool me. Moving to another topic, I was reading about ksh93 in the recent AT&T book on reusable UNIX software. They've extended the pattern syntax so it's equivalent to egrep style regexps (my guess is that zsh's are pretty close), and added the nice touch that some option of print will convert from a regexp to a ksh pattern. There are lots of handy things for writing scripts, but I tend to use zsh only interactively, so for all I know some of these may already exist, although some definitely don't: I can't have a variable called a.fred, for example. One interesting, and probably not too hard feature (now that TCL and Perl have done it) is dynamic loading of commands (on systems which support it). The idea is that they've written a library of routines wc(argc, argv), basename(argc, argv) and so on which are all POSIX implementations of the commands of the same names (so you can wrap a 10 line main around them to get the POSIX commands), and if you want (and your machine supports it), you can arrange for ksh to dynamically load this library, making lots of commands builtins. It would be a nice addition to zsh, I think: the mechanism that Perl uses is more complex, because of its different types, but TCL's extensions are just bunches of routines which take (int argc, char **argv), so presumably the mechanism it uses to dynamically load things could be borrowed.