From owner-freebsd-hackers@FreeBSD.ORG Tue May 28 15:07:32 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 8FD3D9F3 for ; Tue, 28 May 2013 15:07:32 +0000 (UTC) (envelope-from linnemannr@gmail.com) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by mx1.freebsd.org (Postfix) with ESMTP id 6BC3E124 for ; Tue, 28 May 2013 15:07:32 +0000 (UTC) Received: by mail-pa0-f47.google.com with SMTP id kl13so1872323pab.34 for ; Tue, 28 May 2013 08:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=6M98iu3k9P57kT1m3PL3lTBOyLeICYqu0bEnqmY7rig=; b=dJGl68N3BtMtHWlVYprCPvA6FXRycpPHmHdFa19r2nBRFoqc/SJnEfVTT2XGj5fEOH zAtlXHXjs73s6dQtA5qcH2+jmRDtgXBHs984u1voqXkmcIsMaC+b7hil/mIGuoHgChB8 4yTjRvCR3gg+LBzSUrH22GP9MnDF93UcmAZ65x7wUdmw5EWEeQdVnck4ozWPzwfHKEza uVZd1S4dyOQaadtoRlzcIEzLUSzKVsVT5nwRhx4fQE68/KvsKsrV0CAJqpzQ0YLMfndv x/Ob4M8v+xFEULTyB5GkxEUXfIWq2XOEmJIbVpida9Gm5fIkjgR+kkSBUwak54zrKvHG YSUw== X-Received: by 10.68.196.196 with SMTP id io4mr33670794pbc.166.1369753651762; Tue, 28 May 2013 08:07:31 -0700 (PDT) Received: from [192.168.1.144] (ip70-185-206-95.ok.ok.cox.net. [70.185.206.95]) by mx.google.com with ESMTPSA id ig4sm5123332pbc.18.2013.05.28.08.07.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 May 2013 08:07:30 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: /bin/sh => STDIN & functions, var scope messing From: Reid Linnemann In-Reply-To: Date: Tue, 28 May 2013 10:07:58 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <47252E1F-0965-4772-AE40-865BE5D05CD8@gmail.com> References: <20130527.194235.693.1@DOMY-PC> To: Ryan Stone X-Mailer: Apple Mail (2.1503) Cc: rank1seeker@gmail.com, FreeBSD Hackers 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: Tue, 28 May 2013 15:07:32 -0000 On May 28, 2013, at 7:00 AM, Ryan Stone wrote: > On Tue, May 28, 2013 at 5:48 AM, V=E1clav Zeman = wrote: > Curious. Which of the two behaviours is POSIXly correct? >=20 > I believe that /bin/sh's behaviour is correct. I don't know what = shell the manpage is referring to, but it's not bash (bash does the same = thing in a pipeline). Perhaps it's referring to csh? If that is the = case that line is probably causing more confusion rather than = alleviating it. I believe it's referring to csh, possible ksh as well. I tried a similar = experiment with tcsh: #!/bin/tcsh alias fn set var=3D12 set var=3D echo $var yes | fn echo $var=