From owner-freebsd-bugs@FreeBSD.ORG Mon Oct 15 18:26:24 2012 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 801B64AF; Mon, 15 Oct 2012 18:26:24 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 84FA58FC08; Mon, 15 Oct 2012 18:26:23 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id jf20so2509831bkc.13 for ; Mon, 15 Oct 2012 11:26:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=reF4HHTd1bsQtr661ZFZetPFyPe4dwr8teIHf5f86w0=; b=Y8yENwnPkUvVdXm4WqwrmEtMbgaMwLH8z2zOBqDxq+Cb1MdVtjoY6Rpx49IyHw9zG+ 8lmk2l7XlcCO4alkwDxX31MZvQDJFxm8OuZe3W6K4waTPv8sK1IV+WdOi0PUIzhVz7Ki bv9WZ71d4yfcsXoSYovGjBhKYC3WBTMfS192srg6sMG5xFqDzgm5Ejmf+PlFJE46ZNj0 bkmtujZg2F7VDjgQ9fUt19JYbz1rbakk7Vbc2fqD9lKjUSplehfXpxLyM5pRTzWXPX1t 5A1jZJOYYsCZ3/MdzsUfWyMjRDUWr+8vWOTwn1oHeZ0sd8fVpUjiHuWZE26BFm7ojdIb i/Ug== MIME-Version: 1.0 Received: by 10.204.7.213 with SMTP id e21mr3345963bke.32.1350325582578; Mon, 15 Oct 2012 11:26:22 -0700 (PDT) Sender: utisoft@gmail.com Received: by 10.204.50.197 with HTTP; Mon, 15 Oct 2012 11:26:22 -0700 (PDT) In-Reply-To: <507C39D0.9030909@gmail.com> References: <201210141319.q9EDJN6H085443@freefall.freebsd.org> <507C39D0.9030909@gmail.com> Date: Mon, 15 Oct 2012 19:26:22 +0100 X-Google-Sender-Auth: FEIK7E_ngwIE_l8Jb5vcpP7FuEs Message-ID: Subject: Re: docs/172692: [PATCH] Bring parts of the rc scripting guides up to date From: Chris Rees To: Michael Telahun Makonnen Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-doc@freebsd.org, freebsd-rc@freebsd.org, freebsd-bugs@freebsd.org, "bug-followup@freebsd.org" X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2012 18:26:24 -0000 On 15/10/2012, Michael Telahun Makonnen wrote: > Some minor nits: > > - have the same prefix: ${name}. For > + have the same prefix: ${name}_. For > > You should add the same correction to the very next sentence, which reads: > > Note: While it is possible to use a shorter name internally, e.g., just Done, thanks! > > > @@ -491,15 +491,6 @@ > our script will save us from possible > collisions with the &man.rc.subr.8; namespace. > > - As long as an &man.rc.conf.5; variable and its > - internal equivalent are the same, we can use a more > - compact expression to set the default value: > - > - : ${dummy_msg:="Nothing > started."} > - > - The current style is to use the more verbose form > - though. > - > > Not sure why you felt this paragraph needed to be removed. Because the style is clearer and makes it much more obvious when a variable is having its own default value set. In ports at least, the current style is to use the less verbose form. > @@ -512,7 +503,11 @@ > > > Here we use dummy_msg to actually > - control our script, i.e., to emit a variable message. > + control our script, i.e., to emit a variable message. > + Use of a shell function is overkill here, since it only > + runs a single command; an equally valid alternative is: > + > + start_cmd="echo \"$dummy_msg\"" > > While you are technically correct, I think you misunderstood the > writer's intent, which was to show how an rc.conf(8) variable can be > used in a subroutine to control the behavior of the command. I agree > that the example isn't a very good one (in that it doesn't depict a > valid use case), but I think the "spirit" is correct. Maybe you can > suggest a better example? > I think that this script is very simple by design, and making a better example would complicate it. It is definitely worth pointing out the alternative though; it makes useful food for thought; both examples with a disclaimer. Thank you very much for commenting, and I feel bad that I'm fobbing you off. You've raised genuine points, but I had already considered them. Please keep on at me if you think I still need to do something about it. Chris [1] http://www.bayofrum.net/~crees/patches/rc-scripting-modernise2.diff -- Chris Rees | FreeBSD Developer crees@FreeBSD.org | http://people.freebsd.org/~crees