From owner-freebsd-questions@FreeBSD.ORG Sun May 19 06:43:42 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AE8B4E1B for ; Sun, 19 May 2013 06:43:42 +0000 (UTC) (envelope-from quartz@sneakertech.com) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) by mx1.freebsd.org (Postfix) with SMTP id 4F64FB64 for ; Sun, 19 May 2013 06:43:41 +0000 (UTC) Received: (qmail 29906 invoked by uid 0); 19 May 2013 06:43:40 -0000 Received: from 173.48.104.62 (HELO ?10.2.2.1?) (173.48.104.62) by relay01.pair.com with SMTP; 19 May 2013 06:43:40 -0000 X-pair-Authenticated: 173.48.104.62 Message-ID: <5198749C.5050904@sneakertech.com> Date: Sun, 19 May 2013 02:43:40 -0400 From: Quartz User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: "" Subject: Re: check variable content size in sh script References: <5194F65F.6080503@a1poweruser.com> <5194FB0A.9090400@tundraware.com> <13CA24D6AB415D428143D44749F57D7201F4D41F@ltcfiswmsgmb26> <5197998E.6050200@sneakertech.com> <51979A8B.8080703@tundraware.com> <5197A526.7020302@sneakertech.com> <20130518180634.9e5fd3c2.freebsd@edvax.de> <519814A7.8070702@sneakertech.com> <13CA24D6AB415D428143D44749F57D7201F508F2@ltcfiswmsgmb26> <13CA24D6AB415D428143D44749F57D7201F50963@ltcfiswmsgmb26> In-Reply-To: <13CA24D6AB415D428143D44749F57D7201F50963@ltcfiswmsgmb26> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 May 2013 06:43:42 -0000 > I say this from a FreeBSD context. It may entirely be possible that a > Linux distro uses bash in /bin/sh Yes. For most (all?) linux distros as well as osx, /bin/sh is actually bash. When I say "emulation mode" I mean running a script with a "#!/bin/sh" header on a system that doesn't have a real copy of sh. Whatever shell ends up running the script is effectively emulating sh's environment, at least in my mind. Bash is well known for not complaining when you use bash-specific features in a script which uses a "#!/bin/sh" header. This trips up many a programmer and causes script failures on systems where sh is not actually bash in disguise. This is why I question some things as to whether they're *really* valid pure sh syntax and not something that just happens to work in whatever shell is pretending to be sh (which I thought was tcsh on this machine I just did that test on, but on second look maybe not). ______________________________________ it has a certain smooth-brained appeal