Date: Fri, 8 Jan 1999 19:27:46 +0000 From: Ben Smithurst <ben@scientia.demon.co.uk> To: Alan Bawden <Alan@LCS.MIT.EDU> Cc: freebsd-questions@FreeBSD.ORG Subject: Re: messing with /etc/rc.conf Message-ID: <19990108192746.B63511@scientia.demon.co.uk> In-Reply-To: <8Jan1999.042549.Alan@LCS.MIT.EDU> References: <8Jan1999.042549.Alan@LCS.MIT.EDU>
next in thread | previous in thread | raw e-mail | index | archive | help
Alan Bawden wrote: > There is a comment at the front of /etc/rc.conf that says: > > # All arguments must be in double or single quotes. Which is not quite true, arguments like YES or NO needn't be quoted, but try explaining that to lusers... > It's not clear exactly what the restriction here is, but I recently learned > that if rc.conf contains the following: > > ntpdate_flags="-bs $(awk '$1 == "server" || $1 == "peer" {print $2}' /etc/ntp.conf)" > > something will occasionally re-write this to read: > > ntpdate_flags="-bs $(awk '$1 == " Well obviously, since the first non-escaped quote will terminate the quoted string. Escape the quotes by preceding them with a backslash within the quoted string and it might work: ntpdate_flags="-bs $(awk '$1 == \"server\" || $1 == \"peer\" {print $2}' /etc/ntp.conf)" > 1. What is it that makes this change. And what exactly are the rules it > applies when parsing/rewriting the file? The file is parsed by sh(1), read it's man page for quoting rules. > 2. If I move the setting of ntpdate_flags into /etc/rc.conf.local, will > whatever this thing is leave it alone there? No, it's still parsed by sh(1). -- Ben Smithurst ben@scientia.demon.co.uk send a blank message to ben+pgp@scientia.demon.co.uk for PGP key To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990108192746.B63511>