Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 07 Feb 2012 03:13:28 +0100
From:      Dirk Engling <erdgeist@erdgeist.org>
Cc:        freebsd-rc@FreeBSD.org
Subject:   Re: Proposal ipv6_addrs_common
Message-ID:  <4F3088C8.9090505@erdgeist.org>
In-Reply-To: <20120207.072925.1861639312875773760.hrs@allbsd.org>
References:  <4F2F442F.3030509@erdgeist.org> <20120207.064701.1809281571072237708.hrs@allbsd.org> <4F304F54.4020802@FreeBSD.org> <20120207.072925.1861639312875773760.hrs@allbsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
-----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-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F3088C8.9090505>