From owner-freebsd-questions@FreeBSD.ORG Mon Mar 14 07:16:51 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1FBA1065672 for ; Mon, 14 Mar 2011 07:16:51 +0000 (UTC) (envelope-from 839273@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id 58EF38FC20 for ; Mon, 14 Mar 2011 07:16:51 +0000 (UTC) Received: by ywf9 with SMTP id 9so2212959ywf.13 for ; Mon, 14 Mar 2011 00:16:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:reply-to:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=v9WVIy5Wiv4NfMLwhr2jgDQ3YyN99bXBWdeXzfk0UFA=; b=RlZniNse3JxgCoarF5JqSTK1n8AKISFrQTMXkESFmVPHNyurAvLzSvR9f6uu/4ya/R 1a9TbxQrovfp/wiRopegKNJTvUSHOewmQcauB4agyArK+iYFnH4svbiH3DeVTu6TaOUW Q1GlIqBz8vY4G75v3aaGGIBxp9plf7KbN6wEw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=d/o6h+x1zrmcLVjIrWGWw8dETuwWCSr4fj2vvvmlX5sRtwkfcJ8/vahGIh76hcZn1V 1xwZJJagzmatnW3cGX6LfcXpZGxF8fFyRRQUY37lYHgLIOa5fyVpAn44zGGR4Je5xpe0 pLcSUyWXfV6MA5j7FRPLByRCbyGpZYou2LLSw= MIME-Version: 1.0 Received: by 10.150.169.8 with SMTP id r8mr5410142ybe.447.1300087010585; Mon, 14 Mar 2011 00:16:50 -0700 (PDT) Sender: 839273@gmail.com Received: by 10.150.216.2 with HTTP; Mon, 14 Mar 2011 00:16:50 -0700 (PDT) In-Reply-To: <759A467E-407A-4DB8-9756-08011B5405F0@vicor.com> References: <759A467E-407A-4DB8-9756-08011B5405F0@vicor.com> Date: Mon, 14 Mar 2011 02:46:50 -0430 X-Google-Sender-Auth: c6M3t_a2aRvSAqqBkO6h-PMr4Ng Message-ID: From: Andres Perera To: Devin Teske Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: Maxim Khitrov , FreeBSD Subject: Re: Shell script termination with exit function in backquotes X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: 839273@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2011 07:16:51 -0000 On Sun, Mar 13, 2011 at 9:49 PM, Devin Teske wrote: > If you make the changes that I've suggested, you'll have consistent execu= tion. The reason you're having inconsistent behavior is because Linux has /= bin/sh symbolically linked to /bin/bash while FreeBSD has a more traditiona= l shell (we'll call it bourne shell "plus"). that is misleading because command substitutions have traditionally invoked subshells, and freebsd sh(1)/ash is an exception, not the norm in this case, ksh and bash deviates are clearly closer to standard bourne behaviour