From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.net.au (8.7/8.7.1) with SMTP id IAA20056 for ; Fri, 27 Oct 1995 08:16:09 +1000 (EST) Received: from euclid.skiles.gatech.edu by gatech.edu with SMTP id AA16075 (5.65c/Gatech-10.0-IDA for ); Thu, 26 Oct 1995 18:13:46 -0400 Received: by euclid.skiles.gatech.edu (5.x/SMI-SVR4) id AA25436; Thu, 26 Oct 1995 18:11:16 -0400 Resent-Date: Thu, 26 Oct 1995 16:13:26 +0100 (MET) Old-Return-Path: From: Zoltan Hidvegi Message-Id: <199510262212.XAA10168@bolyai.cs.elte.hu> Subject: Re: ZSH's future [longish] ? To: mdb@cdc.noaa.gov (Mark Borges) Date: Thu, 26 Oct 1995 16:13:26 +0100 (MET) In-Reply-To: <9510260626.AA26444@bjerknes.cdc.noaa.gov> from "Mark Borges" at Oct 26, 95 00:26:20 am X-Mailer: ELM [version 2.4 PL24] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: hzoli@cs.elte.hu Resent-Message-Id: <"eLhuM3.0.MD6.3U0am"@euclid> Resent-From: zsh-workers@euclid.skiles.gatech.edu X-Mailing-List: archive/latest/495 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@euclid.skiles.gatech.edu > ... > Shell), and is intended to conform to the IEEE P1003.2/ISO 9945.2 > Shell and Utilities standard. KSH-93 provides an enhanced programming > ... I think zsh is mostly POSIX compatible. I think it would not be difficult to improve POSIX compatibility without affectin present features. I already did some work for it and I use zsh as /bin/sh for more than a half year now without problems. > environment in addition to the major command-entry features of the BSD > shell "csh". With KSH-93, medium-sized programming tasks can be > performed at shell-level without a significant loss in performance. In > addition, "sh" scripts can be run on KSH-93 without modification. I use zsh for these medium-sized programming staff. It is very poverfull, and it has the advantage that it is free and I can compile zsh on any machine I have (there are 7 different unices here). > The code should conform to the IEEE POSIX 1003.1 standard and to the > proposed ANSI-C standard so that it should be portable to all such Thanks to Richard, zsh is one of the most portable program I've ever seen. I think ksh could'n beat it. > systems. Like the previous version, KSH-88, it is designed to accept > eight bit character sets transparently, thereby making it > internationally compatible. It can support multi-byte characters sets > with some characteristics of the character set given at run time. This is a weak point in zsh, since it has problems with character codes between 128 and 159. This is not really a big broblem sine this code range is not usually used for printable characters. Multibyte character support is completely missing. I may try to do something for these sometime (but I probably won't do anything before next summer). History features of zsh are quite good I think (except some bugs in the baseline which I fixed long ago), and command line editing is unbeatable. Same for the I/O capabilities. Performance is also pretty good although I did not compared with ksh. The only thing missing from zsh's arithmetic capabilities is floating point arithmetic. The vanilla version may also have problems with indexed arrays in arithmetic expressions and assignments inside $((...)) substitutions. > o Arrays: KSH-93 supports both indexed and associative arrays. The > subscript for an indexed array is an arithmetic expression, > whereas, the subscript for an associative array is a string. I think zsh provides all of these array features. Some of this code is broken in the baseline version, but I fixed these problems long ago. > o Substring Capabilities: KSH-93 allows you to create a substring > of any given string either by specifying the starting offset and > length, or by stripping off leading or trailing substrings > during parameter substitution. You can also specify attributes, > such as upper and lower case, field width, and justification to > shell variables. Zsh can handle substrings perfectly and the variable expansion features are excelent. Unfortunately the baseline release have some bugs here but I fixed these bugs log ago. > o More pattern matching capabilities: KSH-93 allows you to specify > extended regular expressions for file and string matches. Zsh glob patterns can do anything that an extended regular expression can do. This syntax is different but I think this is not really a big problem. A bonus with zsh that it can use exclude patterns and file modes for globing and supports qualifiers. > o KSH-93 uses a hierarchal name space for variables. Compound > variables can be defined and variables can be passed by > reference. In addition, each variable can have one or more > disciplines associated with it to intercept assignments and > references. > > o Improved debugging: KSH-93 can generate line numbers on > execution traces. Also, I/O redirections are now traced. There > is a DEBUG trap that gets evaluated after each command so that > errors can be localized. These seems to be missing from zsh. An especially week point of zsh is special variable handling. Job control is fully functional in zsh. > o Added security: KSH-93 can execute scripts which do not have > read permission and scripts which have the setuid and/or setgid > set when invoked by name, rather than as an argument to the > shell. It is possible to log or control the execution of setuid > and/or setgid scripts. The noclobber option prevents you from > accidentally erasing a file by redirecting to an existing file. These features are already in zsh, or can be added if necessary. When zsh invoked as setuid, it disables user startup/shutdown files. I think it would be reasonable to source an additional suid_zprofile when invoked as a suid script (as it is already done when invoked as sh/ksh). > o KSH-93 can be extended by adding built-in commands at run > time. In addition, KSH-93 can be used as a library that can be > embedded into an application to allow scripting. That would be nice in zsh as well. It may help to keep zsh a small shell and load feature modules on-demand. E.g. I often write complicated scripts with zsh where the whole zle staff is not needed. To summarize my opinion, zsh is at least as good as ksh. It has outstanding interactive capabilities with advanced features completely missing from ksh. But it can also be used as a powerful script language. An example: with my releases the expansion of ${${(f)$(