Proposal ipv6_addrs_common
Doug Barton
dougb at FreeBSD.org
Sat Feb 11 02:00:21 UTC 2012
On 02/06/2012 14:29, Hiroki Sato wrote:
> Doug Barton <dougb at FreeBSD.org> wrote
> in <4F304F54.4020802 at FreeBSD.org>:
>
> do> On 02/06/2012 13:47, Hiroki Sato wrote:
> do> > It actually depends on the newline
> do>
> do> That's way too fragile, as users are likely to put them all in one line
> do> since shell syntax doesn't differentiate (assuming non-wacky values of IFS).
>
> I don't think so. In this syntax a newline character is a separator
> distinguished from normal white spaces by read statement.
>
> do> > echo "$foo" | while read L; do echo $L; done
Ok, I was looking only at what you wrote in your last message, I forgot
what you're trying to accomplish.
Having thought more about this I still think that using rc.conf
variables for this is too fragile. Rather than introducing a new format
for rc.conf stuff what do you think about putting the new mechanism in
its own file? That way you can still use while/read to easily suck in
the free-form configuration stuff without creating something new for
rc.conf itself.
I'm thinking something along the lines of a default name of
/etc/ifconfig.$if, and the network.subr bits could do something like this:
if [ -n "$ifconfig_$IF" ]; then
<do stuff>
elif [ -s "/etc/ifconfig.$IF" ]; then
while read line ...
fi
You can add refinements such as if ifconfig_$IF contains a path name
that you use that file instead.
Doug
--
It's always a long day; 86400 doesn't fit into a short.
Breadth of IT experience, and depth of knowledge in the DNS.
Yours for the right price. :) http://SupersetSolutions.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-rc/attachments/20120211/cc5e47d4/signature.pgp
More information about the freebsd-rc
mailing list