Date: Sat, 03 Mar 2001 08:50:13 -0800 From: Cy Schubert - ITSD Open Systems Group <Cy.Schubert@uumail.gov.bc.ca> To: "Jacques A. Vidrine" <n@nectar.com> Cc: "Brian F. Feldman" <green@FreeBSD.ORG>, Will Andrews <will@physics.purdue.edu>, FreeBSD Architecture <arch@FreeBSD.ORG>, bde@zeta.org.au, obrien@nuxi.com, nate@yogotech.com Subject: ksh93 (was: Re: cvs commit: src/gnu/usr.bin/binutils/ar ...) Message-ID: <200103031650.f23GoWS12086@cwsys.cwsent.com> In-Reply-To: Your message of "Sat, 03 Mar 2001 09:19:58 CST." <20010303091958.A68223@spawn.nectar.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <20010303091958.A68223@spawn.nectar.com>, "Jacques A.
Vidrine" write
s:
> On Sat, Mar 03, 2001 at 01:04:04AM -0500, Brian F. Feldman wrote:
> > As far as making rc compatible with ksh... ksh is a _super_set of the POSIX
>
> > shell, not a completely, totally new language. This means in all but the
> > most esoteric cases, it will act exactly the same (or better, but compatibl
> y
> > so).
>
> I already tried dropping ksh93 into /bin/sh and booting with it. Two
> issues came up immediately: the `local' command, and some business
> with signal handlers (can't recall exact details at the moment).
> I don't think these would be hard to fix, though.
I can see a problem with replacing ash with ksh. Sure ksh is a
superset of sh, it is that superset that could be a problem for some
users. For example one may have an application (binary, perl or shell
script) in /usr/local/bin, let's take print for example. Once ash has
been replaced by ksh, /usr/local/bin/print will no longer be executed
in favour of the builtin ksh print.
There is a reason why most of the major vendors ship both sh and ksh.
That is because they are not 100% compatible in all cases. Sure,
comparing features that are common to both they are 100% compatible,
however the extensions to the language could cause problems for some
applications. In the the case of the ksh extensions only (ignoring the
common features), they are 0% compatible, see my print builtin example
above, why because ksh would use the builtin print while sh would use
print as found in the PATH, e.g. /usr/local/bin/print, which in my
example might be more like printf, logger, or something that is not
like ksh print.
If we are going to make ksh the default shell, the following needs to
be done:
1. Default disabling of all ksh builtins that could conflict with
applications built by the end user, or
2. Modifying ksh to support /etc/kshrc and ~/.kshrc similar to bash
tcsh (csh) where a user could disable conflicting builtins --
I think this is a hack, or
3. Give the FreeBSD community a very long lead time, at least a year
to allow users to find and modify scripts that may have problems
with the change, then replace ash -- I'm not enamoured with this
option, or
4. Maintain both shells, then make ksh default boot shell after some
lead time (I would think not as much lead time as #2 above), while
still maintaining sh. This is what most of the major UNIX vendors
do and with good reason, see print example above.
4a. Option 4 however ksh has a hard link of sh pointing to it and
sh is renamed ash. Once again, after a good amount of lead time
to allow the FreeBSD community to prepare for the change.
If we are going to import ksh93 into the source tree, which I think is
a good thing, my vote is # 4 or # 4a. For something as critical as a
shell that is used virtually everywhere I think 100% backward
compatibility must be maintained and therefore we should keep ash in
FreeBSD. Boot scripts can reference #!/bin/ksh a short while after
notifying people on -stable (a plan would be nice). /bin/sh should be
renamed to /bin/ash with a /bin/sh hard link linked to it. Later we
can change the /bin/sh hard link to /bin/ksh, while keeping /bin/ash
for backward compatibility (if anyone has forgotten my point about
compatibility by now see my print example above).
Hopefully I covered it all.
Regards, Phone: (250)387-8437
Cy Schubert Fax: (250)387-5766
Team Leader, Sun/Alpha Team Internet: Cy.Schubert@osg.gov.bc.ca
Open Systems Group, ITSD, ISTA
Province of BC
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103031650.f23GoWS12086>
