From owner-freebsd-questions@FreeBSD.ORG Fri Oct 10 15:45:38 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C4C92F5 for ; Fri, 10 Oct 2014 15:45:38 +0000 (UTC) Received: from fly.hiwaay.net (fly.hiwaay.net [216.180.54.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8F65B1C for ; Fri, 10 Oct 2014 15:45:37 +0000 (UTC) Received: from kabini1.local (rbn1-216-180-19-37.adsl.hiwaay.net [216.180.19.37]) (authenticated bits=0) by fly.hiwaay.net (8.13.8/8.13.8/fly) with ESMTP id s9AFjaP0026251 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for ; Fri, 10 Oct 2014 10:45:36 -0500 Message-ID: <54380097.9050501@hiwaay.net> Date: Fri, 10 Oct 2014 10:51:51 -0500 From: "William A. Mahaffey III" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.1.2 MIME-Version: 1.0 CC: FreeBSD Questions Subject: Re: sh man page .... References: <5437FB8B.9080008@hiwaay.net> <61956.128.135.70.212.1412955485.squirrel@cosmo.uchicago.edu> In-Reply-To: <61956.128.135.70.212.1412955485.squirrel@cosmo.uchicago.edu> Content-Type: text/plain; charset=windows-1252; format=flowed 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: Fri, 10 Oct 2014 15:45:38 -0000 On 10/10/14 10:38, Valeri Galtsev wrote: > On Fri, October 10, 2014 10:30 am, Michael Sierchio wrote: >> On Fri, Oct 10, 2014 at 8:30 AM, William A. Mahaffey III >> wrote: >> >>> .....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, >> Nor should it. The Bourne Shell is the Bourne Shell, is adequately >> documented by the man page, and warnings about incompatibility are the >> responsibility of those who foist off bash as sh. >> >> You're blaming your own bad habit on others. :-) >> > Let me second it. > > I recently re-discovered (yes, I knew it since long ago, just forgot) that > Linuxes usually have "sh" as a symlink just pointing to bash. It kind of > kicked me out of my chair: security wise (and in general) you shouldn't > use large code (which bash is) to do just a small set of "features" (which > sh is). It just reminded me that Linux started in general as a "hack" and > still didn't fully grew out of it... > > Valeri > > ++++++++++++++++++++++++++++++++++++++++ > Valeri Galtsev > Sr System Administrator > Department of Astronomy and Astrophysics > Kavli Institute for Cosmological Physics > University of Chicago > Phone: 773-702-4247 > ++++++++++++++++++++++++++++++++++++++++ > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" > I quite agree w/ the point of the small, sharp tool that sh is compared to bash, & I like it. Hence, when I bump into these minor incompatibilities that the sh man page is mute on (empty string is an error in arithmetic or logical evaluations, irrespective of bash behavior) when converting from bash to sh, I thought it would be apropos to flag that to the sh man page maintainer. I probably worded my OP badly, I was/am more focused on the rather terse (& incomplete, I think) man page, I just provided the background (conversion from FC14 to FBSD 9.3) as perspective on how the issue came up. Anyway, I hope the man page might be fleshed out a bit, that's all .... TIA & have a nice day :-) .... -- William A. Mahaffey III ---------------------------------------------------------------------- "The M1 Garand is without doubt the finest implement of war ever devised by man." -- Gen. George S. Patton Jr.