From owner-freebsd-rc@FreeBSD.ORG Tue Feb 7 02:13:33 2012 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDCE71065676 for ; Tue, 7 Feb 2012 02:13:33 +0000 (UTC) (envelope-from erdgeist@erdgeist.org) Received: from elektropost.org (elektropost.org [217.13.206.130]) by mx1.freebsd.org (Postfix) with ESMTP id 20D908FC18 for ; Tue, 7 Feb 2012 02:13:32 +0000 (UTC) Received: (qmail 79079 invoked from network); 7 Feb 2012 02:17:25 -0000 Received: from elektropost.org (HELO elektropost.org) (erdgeist@erdgeist.org) by elektropost.org with CAMELLIA256-SHA encrypted SMTP; 7 Feb 2012 02:17:25 -0000 Message-ID: <4F3088C8.9090505@erdgeist.org> Date: Tue, 07 Feb 2012 03:13:28 +0100 From: Dirk Engling User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 References: <4F2F442F.3030509@erdgeist.org> <20120207.064701.1809281571072237708.hrs@allbsd.org> <4F304F54.4020802@FreeBSD.org> <20120207.072925.1861639312875773760.hrs@allbsd.org> In-Reply-To: <20120207.072925.1861639312875773760.hrs@allbsd.org> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@FreeBSD.org Subject: Re: Proposal ipv6_addrs_common X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 02:13:33 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 06.02.12 23:29, Hiroki Sato wrote: > No, my intention is grouping multiple words by a newline. By > using "for", lines cannot be separated from each other in the > following case: > > foo=" foo foo2 bar bar2 baz " - From my understanding all that's to do is to match the ifconfig parameter syntax and expand ip addresses. There's several ways to do that. You can just accept them as positional paramters in a function, and then shift them out one by one, matching inet and inet6, switching state and returning an expanded string to be executed by the caller. You can also match [ ${foo#inet} = ${foo} ] || foo=`expand_ipv4 ${foo}` or case ${foo} in "inet *") ... ; case "inet6 *") ;; to do the actual work. What exactly is the newline for in that case? To make it clearer where single invocations of ifconfig need to be separated? There is no need to introduce any split characters, as inet and inet6 by themself act as such. In fact, they're not even needed as from the parameter itself the address family should become clear. I never understood why the code insist so heavily on the user to specify the inet and inet6 keywords. Any particular reason? erdgeist -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (Darwin) iEYEARECAAYFAk8wiMgACgkQuN1wFypsMNO6ugCfVPEwqZ2aO1ITzWYJdIGkCdLL jRQAn3S5ySaInmgv+Soc5Id0sXfpQhbB =//k2 -----END PGP SIGNATURE-----