From owner-freebsd-questions@FreeBSD.ORG Sat Oct 11 13:27:08 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2854E2FA for ; Sat, 11 Oct 2014 13:27:08 +0000 (UTC) Received: from rgout06.bt.lon5.cpcloud.co.uk (rgout06.bt.lon5.cpcloud.co.uk [65.20.0.183]) by mx1.freebsd.org (Postfix) with ESMTP id B20196CF for ; Sat, 11 Oct 2014 13:27:07 +0000 (UTC) X-CTCH-RefID: str=0001.0A090201.54392FD3.0092, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-Junkmail-Premium-Raw: score=28/50, refid=2.7.2:2014.10.10.74220:17:28.394, ip=86.143.146.172, rules=__HAS_FROM, __PHISH_FROM2, __FRAUD_WEBMAIL_FROM, FROM_NAME_ONE_WORD, __TO_MALFORMED_2, __TO_NO_NAME, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __HAS_MSGID, __SANE_MSGID, __IN_REP_TO, __HAS_X_MAILER, __MIME_VERSION, __CT, __CT_TEXT_PLAIN, __CTE, __ANY_URI, __URI_NO_WWW, __URI_NO_PATH, __INT_PROD_COMP, __SUBJ_ALPHA_NEGATE, __FORWARDED_MSG, BODY_SIZE_1500_1599, BODYTEXTP_SIZE_3000_LESS, __MIME_TEXT_ONLY, RDNS_GENERIC_POOLED, __URI_NS, SXL_IP_DYNAMIC[172.146.143.86.fur], HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, RDNS_SUSP_GENERIC, __PHISH_FROM, __PHISH_SPEAR_STRUCTURE_1, RDNS_SUSP, BODY_SIZE_2000_LESS, __FRAUD_WEBMAIL, BODY_SIZE_7000_LESS X-CTCH-Spam: Unknown Received: from elena.home (86.143.146.172) by rgout06.bt.lon5.cpcloud.co.uk (8.6.122.06) (authenticated as afmcc) id 5436E80D0037B2A4 for freebsd-questions@freebsd.org; Sat, 11 Oct 2014 14:25:39 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btinternet.com; s=btcpcloud; t=1413034027; bh=//8eUkSqyXbvFz816aQuPUHUcFSITppYoIoQCYR03Dg=; h=Date:From:To:Subject:Message-ID:In-Reply-To:References:X-Mailer:MIME-Version; b=I5TeuhW+x1AfOZfJVN8s+N2MG/d23vSGwvfEC5sMp78PW1aIUYYvG8kCQFo16PAisBpYtxKfbih5F7eiaBUF32PGfcft+ySeCWCv/4azz/ZSQG+2AAUv9FrLtcQJDvMEw0ShEfDWNCpu+mY57R2moq1l9KfZ3ImTV9rZQ1PVl+g= Date: Sat, 11 Oct 2014 14:25:38 +0100 From: TonyMc 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> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.22; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Oct 2014 13:27:08 -0000 On Fri, 10 Oct 2014 10:30:19 -0500 "William A. Mahaffey III" 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