Subject: Re: Tab completion in /bin/sh
To: J Chapman Flack <firstname.lastname@example.org>
From: Greg A. Woods <email@example.com>
Date: 05/05/2005 20:38:25
[ On Thursday, May 5, 2005 at 15:44:37 (-0500), J Chapman Flack wrote: ]
> Subject: Re: Tab completion in /bin/sh
> Not a bit of it, in this case. I never set out to write "portable POSIX shell
> scripts." I wrote Korn Shell, i.e. ksh, scripts, which run to perfection on
> ksh, which is available for many platforms and many OSes from its author,
> David Korn, and his employer, AT&T.
Hmm, well I've been porting code now for so many decades that I've
learned to never write scripts for any specific shell unless they're
either guarnateed to be one-time-only hacks or they're explicitly part
of some portability adapter library/hooks so I can make use of
non-portable features (e.g. as I do in my own ~/.profile and ~/.*rc
(I guess it's just one of those "habits" one forms, like always using
version tracking tools for all one's own files. :-)
> But then, having something that ain't ksh included in the base and called
> ksh is just wacked. There could just as easily be a pdksh package (that
> installs a binary named pdksh) for use by people who have invested heavily
> in pdksh scripts they can't get to run in ksh.
"pdksh" really doesn't differ that much from ATT Ksh, esp. not from the
versions that were most widely distributed with other proprietary
operating systems for a very long time, especially when it comes to
running scripts. Even my Ksh-specific login scripts, long developed
exclusively with ATT Ksh, work well with pdksh (though that may be my
bent towards writing portable scripts showing through again :-).
Your description of the NOTES file as "terse" and "1800 words long" does
pdksh a great disservice. Also, even in netbsd-1.6.x there have been
significant and important bug fixes made to /bin/ksh (which
unfortunately are not yet taken back into the original distribution).
The only really nasty bug I've run into myself is this one:
- in pdksh, if the last command of a pipeline is a shell builtin, it is
not executed in the parent shell, so "echo a b | read foo bar" does not
set foo and bar in the parent shell (at&t ksh will).
This may get fixed in the future, but it may take a while.
(mind you that is a really nasty and really annoying bug that's very
difficult to work around in a script that depends upon it!)
Greg A. Woods
H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <firstname.lastname@example.org>
Planix, Inc. <email@example.com> Secrets of the Weird <firstname.lastname@example.org>