Re: What version of korn shell?
From: Lothar Paltins (lpnews001_at_onlinehome.de)
Date: 06/20/04
- Next message: Juan: "Looking for HP-UX OS"
- Previous message: Bill Schindler: "Thanks Joseph"
- In reply to: Frank Slootweg: "Re: What version of korn shell?"
- Next in thread: Frank Slootweg: "Re: What version of korn shell?"
- Reply: Frank Slootweg: "Re: What version of korn shell?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 20 Jun 2004 15:03:05 +0200
Frank Slootweg wrote:
> I think that a more important question is why, in this day and age,
> anyone would be using/wanting a Korn shell while, for all intents and
> purposes (no, I haven't looked at this particular issue, i.e. array
> limits), the (standard, i.e. /usr/bin/sh) POSIX shell is a compatible
> superset of the Korn shell?
Compatible to ksh88. Take a look at /usr/dt/examples/dtksh/ksh93.memo and
the ksh93 man page for the advanced features of the ksh93. Some examples:
Pathnames of the form /dev/tcp/host/port or /dev/udp/host/port for tcp
or udp connection to the corresponding socket.
Pathnames of the form /dev/fd/n for passing and testing open file
descriptors.
${parameter:offset:length} for extracting substrings.
${parameter/pattern/string} for string replacements.
Associative arrays
Number of array elements increased to 4096
Nameref variables to reference another variable.
Integer and floating point arithmetic.
Structured variables consisting of several words separated by a ".".
Discipline Functions.
C interface to add built-in commands.
KEYBD trap that enables changing of key bindings.
ENV variable is evaluated only for interactive shells, no need any more
for cryptic constructs like
ENVFILE=~/.kshrc;ENV='${ENVFILE[(_=1)+(_$-=0)-_${-%%*i*}]}'
...
I think, bash has similar extensions, but I prefere ksh93 because of the
better compatibility to old ksh88 scripts. So the question today isn't
posix-shell or ksh, but bash or ksh93. Using the restricted posix-shell
syntax is ok only for system scripts or for scripts that should be easily
portable between different systems, IMHO.
Lothar
-- Lothar Paltins lpnews001@onlinehome.de
- Next message: Juan: "Looking for HP-UX OS"
- Previous message: Bill Schindler: "Thanks Joseph"
- In reply to: Frank Slootweg: "Re: What version of korn shell?"
- Next in thread: Frank Slootweg: "Re: What version of korn shell?"
- Reply: Frank Slootweg: "Re: What version of korn shell?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|