From owner-freebsd-hackers@FreeBSD.ORG Tue May 28 09:48:50 2013 Return-Path: Delivered-To: hackers@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 0DE3C8A2 for ; Tue, 28 May 2013 09:48:50 +0000 (UTC) (envelope-from vhaisman@gmail.com) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com [209.85.217.178]) by mx1.freebsd.org (Postfix) with ESMTP id 8FD7C891 for ; Tue, 28 May 2013 09:48:49 +0000 (UTC) Received: by mail-lb0-f178.google.com with SMTP id w10so7401199lbi.23 for ; Tue, 28 May 2013 02:48:48 -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=krDz0G1Z3c9BlWi51hQxnXsdgYpPOMWz7765pv+L+Eo=; b=U9xGgpA+l4zwir1rzq64WUZPw0KDKOApvjwvRgCIL3kc1uKSXtGZBvWQF02Pf0L6G6 qptUlFSnFPGH9rnmMbaswU8SuyztwYTVHrXyo2555dhjnerw5DhHB3n85zur10icrSHa qP//DU32tg7UHcI8H9CvlpVGrynPxIFTEDEfMJokrXc6AzTP17y7lPpMDj9d1fwpo9A1 BBhoWTSbsq3rydLNlBLPwLipEaKWF0midmbUkii+Ha0AhvwIl+7wKDmg2mv1/4OHpGJK QH00ETNnq5QKnR+8n6cNJAUROy5lUuG35AaUC8+6k30iicNgF2P3lEnnjtNz8LfbRcfa /ICw== MIME-Version: 1.0 X-Received: by 10.112.89.195 with SMTP id bq3mr16130901lbb.19.1369734527914; Tue, 28 May 2013 02:48:47 -0700 (PDT) Received: by 10.114.98.129 with HTTP; Tue, 28 May 2013 02:48:47 -0700 (PDT) In-Reply-To: References: <20130527.194235.693.1@DOMY-PC> Date: Tue, 28 May 2013 11:48:47 +0200 Message-ID: Subject: Re: /bin/sh => STDIN & functions, var scope messing From: =?UTF-8?Q?V=C3=A1clav_Zeman?= To: Reid Linnemann Content-Type: text/plain; charset=UTF-8 Cc: rank1seeker@gmail.com, hackers@freebsd.org 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 09:48:50 -0000 On 27 May 2013 21:58, Reid Linnemann wrote: > from SH(1) > > "Note that unlike some other shells, sh executes each process in a pipe- > line with more than one command in a subshell environment and as a > child > of the sh process." > > I'm taking this to mean that redirecting to sh_f has sh_f execute in a > subshell in which global_scope_var changes, but the original shell's copy > is uncahnged. Curious. Which of the two behaviours is POSIXly correct? -- VZ