Is SVR2 /bin/sh backwards compatible to v7?

Carl S. Gutekunst csg at pyramid.pyramid.com
Fri Feb 3 19:34:26 AEST 1989


In article <165 at apmpyr.nzapmb.co.nz> pgfdp at nzapmb.co.nz (Paul Fox ) writes:
>... our development and our applications all run in the "ucb" universe....
>When writing shell scripts and makefiles, it would be nice if we could
>make use of the bug fixes and enhancements that have gone into /bin/sh
>since v7, that is, be able to run the AT&T /bin/sh instead of the UCB
>/bin/sh.
>
>Does anyone see a problem with simply _replacing_ the UCB /bin/sh (i.e. the
>one called /.ucbbin/sh) with the AT&T shell (the one called /.attbin/sh)?

This may actually work, if only because most of the shell scripts in BSD are
pretty straight-forward. The differences in the System V shell I am aware of
are:

- test(1) is built in, and returns different values for directories. Since
  the System V test(1) returns values that are more correct than the BSD
  test(1), it seems unlikely that this would break anything.

- Executable names are hashed. (The C-Shell does this too, although the im-
  plementation is quite different.) I've seen a number of cases where scripts
  that create executables and then invoke them work as expected on the old V7
  shell, but get confused by the System V shell. There are a few scripts in
  OSx that are sensitive to this, though all of them I've seen explicitly
  invoke "#!/bin/att /bin/sh" to force them into the System V shell.

- echo(1) is built in, and the semantics are different, per Doug Gwyn's note.
  This may actually cause some serious trouble for scripts that expect to be
  run interactively, or that try to get fancy with output formats. I can't
  think of any OSx scripts that would be sensitive to this.

One thing I *would* expect to see get confused are "Configure" programs,
that try to guess what system you are running on. Note that Larry Wall's
Configure does not have this problem; it isn't surprised to see a System
V shell on a Berkeley system, since Sun has been shipping that for years.

FYI, if you are on OSx 4.0 or later, the att universe shell is SVR3.0.

<csg>



More information about the Comp.unix.wizards mailing list