Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

ZSH's future [longish] ?



I know, I hate these vague and open-ended subject lines, too. This is
not really related to zsh development either. So feel free to quit
reading, if you've even gotten this far...

Anyway, I discovered this URL last night:

     http://www.research.att.com/orgs/ssr/book/reuse/

and apparently ATT is giving away free copies of ksh93 for personal
use. You have to agree to a non-exclusive license agreement, but it
appears to be fairly liberal for single user usage. Unless I'm
misunderstanding it (quite possible) and will have the ATT police
after me tomorrow.

I was curious if anyone on this list has seen it (I've appended a list
of features below) and what their reactions would be.

How do the people actively involved in ZSH development think zsh
compares with ksh93? (Windows95, ksh93. Yuck. What's the world coming
to? ;-) 

Lest I be misunderstood, let me state that I've really enjoyed having
zsh as my shell, and have been using it for the past 4 years. I like
it better than ksh88. I don't see myself using ksh anytime soon. 

But I'm wondering if people will start flocking to ksh93 (now that it
appears to be easier to get a hold of), and the incentive and impetus
for actively developing zsh will wane such that zsh will be more of a
"hobby" than it already is.

Comments? Anyone care to do a feature-by-feature comparison? (I'm not
sure what all of them mean) If anything glaring is missing in zsh,
does anyone foresee it being added in zsh-4.0?

After a quick glance, it appears ksh93 can handle arithmetic and
arrays in a more powerful way than zsh currently does, e.g.,

	$ ./ksh
	$ ((a=1.e-3+3.4/1.2))
	$ echo $a
	2.83433333333
	$ ^D
	$ ((a=1.e-3+3.4/1.2))
	zsh: bad math expression: illegal character: .

But, so what, really. If one wants to do heavy duty math in a script,
use perl, right?

I think zsh's niche is being king of the interactive features and
conveniences. Perhaps that should be stressed more in the ZSH WWW
pages? 

  -mb-

==============================================================================
KSH-93 - The KornShell Command and Programming Language

KSH-93 is the most recent version of the KornShell Language described
in "The KornShell Command and Programming Language," by Morris Bolsky
and David Korn of AT&ampT Bell Laboratories. The KornShell is a shell
programming language, which is upward compatible with "sh" (the Bourne
Shell), and is intended to conform to the IEEE P1003.2/ISO 9945.2
Shell and Utilities standard. KSH-93 provides an enhanced programming
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.

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

KSH-93 provides the following features, many of which were also
inherent in KSH-88:

    o Enhanced Command Re-entry Capability: The KSH-93 history
      function records commands entered at any shell level and stores
      them, up to a user-specified limit, even after you log off. This
      allows you to re-enter long commands with a few keystrokes -
      even those commands you entered yesterday. The history file
      allows for eight bit characters in commands and supports
      essentially unlimited size histories.

    o In-line Editing: In "sh", the only way to fix mistyped commands
      is to backspace or retype the line. KSH-93 allows you to edit a
      command line using a choice of EMACS-TC or "vi" functions. You
      can use the in-line editors to complete filenames as you type
      them. You may also use this editing feature when entering
      command lines from your history file. A user can capture
      keystrokes and rebind keys to customize the editing interface.

    o Extended I/O Capabilities: KSH-93 provides several I/O
      capabilities not available in "sh", including the ability to:
        * specify a file descriptor for input and output
        * start up and run co-processes
        * produce a prompt at the terminal before a read
        * easily format and interpret responses to a menu
        * echo lines exactly as output without escape processing
        * format output using printf formats.
        * read and echo lines ending in "\\".

    o Improved performance: KSH-93 executes many scripts faster than
      the System V Bourne shell. A major reason for this is that many
      of the standard utilities are built-in. To reduce the time to
      initiate a command, KSH-93 allows commands to be added as
      built-ins at run time on systems that support dynamic loading
      such as System V Release 4.

    o Arithmetic: KSH-93 allows you to do integer arithmetic in any
      base from two to sixty-four. You can also do double precision
      floating point arithmetic. Almost the complete set of C language
      operators are available with the same syntax and
      precedence. Arithmetic expressions can be used to as an argument
      expansion or as a separate command. In addition there is an
      arithmetic for command that works like the for statement in C.

    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.

    o Shell Functions and Aliases: Two mechanisms - functions and
      aliases - can be used to assign a user-selected identifier to an
      existing command or shell script. Functions allow local
      variables and provide scoping for exception handling. Functions
      can be searched for and loaded on first reference the way
      scripts are.

    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.

    o More pattern matching capabilities: KSH-93 allows you to specify
      extended regular expressions for file and string matches.

    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.

    o Job Control: On systems that support job control, including
      System V Release 4, KSH-93 provides a job-control mechanism
      almost identical to that of the BSD "csh", version 4.1. This
      feature allows you to stop and restart programs, and to move
      programs between the foreground and the background.

    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.

    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.



Messages sorted by: Reverse Date, Date, Thread, Author