From owner-freebsd-hackers@FreeBSD.ORG Fri May 31 18:49:22 2013 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4234D40E for ; Fri, 31 May 2013 18:49:22 +0000 (UTC) (envelope-from linnemannr@gmail.com) Received: from mail-ob0-x235.google.com (mail-ob0-x235.google.com [IPv6:2607:f8b0:4003:c01::235]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1A2780 for ; Fri, 31 May 2013 18:49:22 +0000 (UTC) Received: by mail-ob0-f181.google.com with SMTP id 16so3612964obc.40 for ; Fri, 31 May 2013 11:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=0L1jDwDLlCplsXEwbeAb8UqUAAwJYbLjYZU/FOoSaWw=; b=TLXYZdSpW7xfWxeywgeWioPZmr7uwJ2t6PwrQKBuVlVWLrajoUvbhEieTYSwgCC9Yh 28BOfKKAD8z0SueCdV88AZp91YB8MBeX3XiuLkaPvIZFtjbrjNnVtO4EAfHE8Mx/+xNA kxjNkz+UpaJPurguCIFu1QI2ikudsSjSNjqmIJYkjnD72GiksdKbQhnG8CkURohdfjyk /F0ZIrskd61FqdDO+HjlKRBh4sw9NDljSPdtUSbUyP3n2GgS+/YaaBmXtHutEUJyqrqP 13UoFC8yQwLXDFfjTZWqq+QJawirAqTCZHz8ZqbrlImJpjaJhrrHMVqwGcHxD0zb7cXg 3mZg== MIME-Version: 1.0 X-Received: by 10.60.33.102 with SMTP id q6mr6549242oei.111.1370026161717; Fri, 31 May 2013 11:49:21 -0700 (PDT) Received: by 10.182.217.98 with HTTP; Fri, 31 May 2013 11:49:21 -0700 (PDT) In-Reply-To: <13CA24D6AB415D428143D44749F57D7201F6AD11@ltcfiswmsgmb21> References: <20130527.194235.693.1@DOMY-PC> <20130530223031.GA1672@stack.nl> <20130531.175959.745.2@DOMY-PC> <13CA24D6AB415D428143D44749F57D7201F6AD11@ltcfiswmsgmb21> Date: Fri, 31 May 2013 13:49:21 -0500 Message-ID: Subject: Re: /bin/sh => STDIN & functions, var scope messing From: Reid Linnemann To: FreeBSD Hackers Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: "" , Jilles Tjoelker X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 18:49:22 -0000 On Fri, May 31, 2013 at 1:12 PM, Teske, Devin wr= ote: > > If you're arguing we have to change sh's behavior to be more compliant, > jilles already quoted XCU 2.12 (our shell is well within its right to run > any/all lvalue/rvalue operands of a pipe in a sub-shell without > contradicting the guidelines). > > But if you're arguing that it has to change to make things better or > easier=85 I don't know about that. Might just make people lulled into usi= ng a > style that's non-portable. I'd like to keep things the way they are so th= at > if you program for FreeBSD, you're inherently going to program in a fashi= on > that is more portable. > -- > Devin > FWIW bash (invoked as sh) on RHEL-based linux systems exhibits the same behavior- sh-3.2$ var=3D1 sh-3.2$ yes|var=3D2 sh-3.2$ echo $var 1 sh-3.2$ If my opinion matters at all, I would agree that for the sake of portability that behavior be consistent with the majority of sh implementations rather than "right" according to arbitrary ruling.