Stephen Harris wrote:

Solaris /bin/sh was a real real dumb version of the bourne shell.

If you like to create portable scripts, you can do this by downloading:


and using "osh" as a reference implementation. Osh is the old SunOS Bourne
Shell with all bugs that people expect from a SVr4 Bourne Shell. It just has
been rewritten to make it portable, e.g. by converting it from sbrk() to
malloc() that makes it work on Cygwin. This code to convert to malloc() was
written by Geoff Collyer for David Korn for converting the Bourne Shell based
ksh. In 2012, I have rewritten that code to make it fit the SVr4 version of
the Bourne Shell and a month ago, this was tested by American fuzzy lop and so
I could fix a few left over bugs from that conversion.

If you use "osh", you get exactly the same behavior than from a SunOS /bin/sh
up to Solaris 10 included.

The current maintained Bourne Shell installed as "sh" and "bosh" has many
enhancements, including the following:

- A history editor using my original design from 1982, that predates ksh.

- enhanced aliases (much more than ksh implements), the original design
  for this implementaion is also from 1982.

- rcfiles "/etc/sh.shrc" "$HOME/.shrc" for interactive shells

- the "repeat" builtin

- true / false builtin

- pushd / popd / dirs builtin && cd -

- support for read -r

- support for set -o

- support for sh -v -x instead of just set -vx

- support for umask -S

- Support for i; do .... with semicolon

- Report a syntax error for "echo foo |;"

- Bugfix for set -a; read VAR

- Evaluate var2=val2 var1=val1 left to right

- a much better man page

- Support for vfork() to speed up things.


  EMail:joerg at schily.net (home) J?rg Schilling D-13353 Berlin
        joerg.schilling at fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
  URL: http://cdrecord.org/private/ http://sourceforge.net/projects/schilytools/files/'

Search Discussions

Discussion Posts


Follow ups

Related Discussions



site design / logo © 2017 Grokbase