From owner-freebsd-bugs@FreeBSD.ORG Wed Jan 11 15:13:57 2012 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC8A5106566B for ; Wed, 11 Jan 2012 15:13:57 +0000 (UTC) (envelope-from matthewstory@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7652F8FC14 for ; Wed, 11 Jan 2012 15:13:57 +0000 (UTC) Received: by vcbfk1 with SMTP id fk1so935188vcb.13 for ; Wed, 11 Jan 2012 07:13:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=BGvKcDd9ezTZiGJ+ZOGvgtCngjWmmyxUWZn1soEYEvQ=; b=xfcdos3wltYT2woxfyh+BCA1WpJ4P8MGGn1JyaPJmeSl4Pz5bS5AqErHPkms2l9+mI 6lBfUSvMO2n5mrohWGLcrxdh3RU+Oy6MIfjJAcitprqFiwfAhYddlPfyAHi6aT7MCzQO 9rqIcJvUIcks/Zi5O4FJ364IZU+9k9RnItbYM= MIME-Version: 1.0 Received: by 10.220.157.83 with SMTP id a19mr15247184vcx.54.1326293158733; Wed, 11 Jan 2012 06:45:58 -0800 (PST) Received: by 10.52.159.69 with HTTP; Wed, 11 Jan 2012 06:45:58 -0800 (PST) In-Reply-To: <217378425.20120111120149@yandex.ru> References: <201201110800.q0B80Ug4093353@freefall.freebsd.org> <217378425.20120111120149@yandex.ru> Date: Wed, 11 Jan 2012 09:45:58 -0500 Message-ID: From: Matthew Story To: =?KOI8-R?B?68/O2MvP1yDl18fFzsnK?= Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-bugs@freebsd.org Subject: Re: Re[2]: misc/164011: comments in rc.conf cause system loading X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 15:13:57 -0000 2012/1/11 =EB=CF=CE=D8=CB=CF=D7 =E5=D7=C7=C5=CE=C9=CA we're pretty far away from rc.conf bugs here, but all of these tests demonstrate proper functionality of a POSIX shell. =FA=C4=D2=C1=D7=D3=D4=D7=D5=CA=D4=C5, Matthew. > [... snip] > =F7=D9 =D0=C9=D3=C1=CC=C9 11 =D1=CE=D7=C1=D2=D1 2012 =C7., 10:00:30: > #this test FAIL > echo "Test 7" > dddd=3D"" > dddd=3D"ddd"# ddd > echo $dddd > per the shell man page, assignment prior to a simple command exposes the assigned variable to the simple command's environment. what your example above is actually doing, is the following: assign 'ddd#' to the environment variable 'dddd' exec ddd (does not exist) when you get to the echo, dddd is equal to the value "", not the value exposed to ddd's environment. for a useful use of this feature: $ sh -c 'foo=3Dbar python -c "import os; print os.environ[\"foo\"];"' bar relevant snippet from the man page and POSIX spec at the bottom of this message. > [...snip] > #Despite on "Test 2" SUCCESS this "Test 9" FAIL > echo "Test 9" > dddd=3D"" > dddd=3D"ddd"#! ddd > echo $dddd > this does exactly the same as case 7, excepting the value 'ddd#!' is assigned to dddd in ddd's environment prior to executing ddd. sh -c 'foo=3D"bar"#!; echo "$foo"' bar#! [...snip] > the rest of the examples are variations on the same theme. ------from man 1 sh------- Simple Commands If a simple command has been recognized, the shell performs the following actions: 1. Leading words of the form ``name=3Dvalue'' are stripped off and assigned to the environment of the simple command. Redirection operators and their arguments (as described below) are stripped off and saved for processing. for POSIX specification on this topic, see: http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#ta= g_02_09_01 http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#ta= g_02_10_02 --=20 regards, matt