Date: Fri, 10 Feb 2012 18:00:19 -0800 From: Doug Barton <dougb@FreeBSD.org> To: Hiroki Sato <hrs@FreeBSD.org> Cc: freebsd-rc@FreeBSD.org Subject: Re: Proposal ipv6_addrs_common Message-ID: <4F35CBB3.2040501@FreeBSD.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
[-- Attachment #1 --] On 02/06/2012 14:29, Hiroki Sato wrote: > Doug Barton <dougb@FreeBSD.org> wrote > in <4F304F54.4020802@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/ [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iQEcBAEBCAAGBQJPNcuzAAoJEFzGhvEaGryEgZwH/AuktusEmp/4qi7QAUCXSA8L gamwZi9r2tJuhFkaOYR27s4ExRvtl/KyOOX2LiJ2Snr0HLbgFT54f9ugDOf+8Z0R l0rSKWzGansmuyM2WIlstG90IrsWztD71szJWeIRiMEApHtpfkLy4nkItObDpVvR V6zyKtyrqDNQCfZd1+3N6JutAge+rKo+BrdOF8wSLYhnDfWQrVizgKjoTZxPB4dP 78ztZfWPNoXG0gHRBD5erIw3uo9EbuZGM4jTwof2ui0KehOVDiv3cL4g63VMhuk7 o52D2YQn0muji03FAaISF+j8VmLEVdl/HfBLs8+HJi4ObEOPW6YeGX1zxkCsiVU= =zC1s -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F35CBB3.2040501>
