Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Oct 2014 14:25:38 +0100
From:      TonyMc <afmcc@btinternet.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: sh man page ....
Message-ID:  <20141011142538.45c9f45a@elena.home>
In-Reply-To: <5437FB8B.9080008@hiwaay.net>
References:  <5437FB8B.9080008@hiwaay.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 10 Oct 2014 10:30:19 -0500
"William A. Mahaffey III" <wam@hiwaay.net> wrote:

> 
> 
> I have a FBSD 9.3 desktop that supplanted a Linux FC14 desktop used
> for web access, some light development, & other day-to-day tasks
> (i.e. my daily driver, so to speak). I had a bunch of shell scripts
> written to use Linux sh, which was in fact bash, which means it had a
> superset of the arithmetic operators that traditional sh had. When I
> use these scripts under sh under FBSD 9.3, they largely work, though
> there are some minor differences (empty strings evaluate to zero (0)
> under bash, error under sh). The man page for sh doesn't reflect some
> of these compatibilities/incompatibilities, & is a bit short on its
> description of arithmetic evaluations in general. It would be sweet
> if it were updated to document more of the differences/similarities
> w/ bash, since there a clearly a decent number of similarities, &
> only a few (for me) differences. TIA ....
> 

It seems to me you have this the wrong way around.  /bin/sh is the
Bourne shell, bash is sh-like, so surely it is the task of the bash
maintainers to document incompatibilities with the Bourne shell?  The
"a" in bash is for "again", so it is clearly intended as a Bourne-shell
inspired shell.  The example you give of silently evaluating empty
strings as numeric zero is exactly the sort of incompatibility that
should be documented in the bash man page.  But it is not the sh
shell's problem, surely?

Tony





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20141011142538.45c9f45a>