From owner-freebsd-questions Sat Jan 9 19:14:32 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA19638 for freebsd-questions-outgoing; Sat, 9 Jan 1999 19:14:32 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from oolong.camellia.org (oolong.camellia.org [206.119.96.100]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id TAA19633 for ; Sat, 9 Jan 1999 19:14:29 -0800 (PST) (envelope-from alan@oolong.camellia.org) Received: (from alan@localhost) by oolong.camellia.org (8.8.8/8.8.8+Erasmus) id WAA05050; Sat, 9 Jan 1999 22:13:56 -0500 (EST) (envelope-from alan) Date: Sat, 9 Jan 1999 22:13:56 -0500 (EST) References: <8Jan1999.042549.Alan@LCS.MIT.EDU> <19990108192746.B63511@scientia.demon.co.uk> Message-Id: <9Jan1999.220116.Alan@LCS.MIT.EDU> From: Alan Bawden To: freebsd-questions@FreeBSD.ORG In-reply-to: <19990108192746.B63511@scientia.demon.co.uk> (message from Ben Smithurst on Fri, 8 Jan 1999 19:27:46 +0000) Subject: Re: messing with /etc/rc.conf Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Date: Fri, 8 Jan 1999 19:27:46 +0000 From: Ben Smithurst Alan Bawden wrote: > ... 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. Forgive me, but it isn't obvious to me. That second doublequote is -inside- a $( ) pair, and so does -not- terminate the string if `sh' is doing the parsing. Escape the quotes by preceding them with a backslash within the quoted string and it might work: That, in fact, would make it illegal sh syntax. > 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. I did. The file is perfectly legal sh syntax. I was wondering what -other- program it is that parses /etc/rc.conf, and if there was some way I could write something that makes -both- sh, and that other mystery program happy at the same time. > 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). The line I wrote is perfectly legal sh syntax. So if /etc/rc.conf.local is -only- parsed by sh, then that will solve my problem. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message