From owner-freebsd-current Mon Mar 22 7:30:37 1999 Delivered-To: freebsd-current@freebsd.org Received: from peach.ocn.ne.jp (peach.ocn.ne.jp [210.145.254.87]) by hub.freebsd.org (Postfix) with ESMTP id 9503114BD7 for ; Mon, 22 Mar 1999 07:30:35 -0800 (PST) (envelope-from dcs@newsguy.com) Received: from newsguy.com by peach.ocn.ne.jp (8.9.1a/OCN) id AAA17303; Tue, 23 Mar 1999 00:30:24 +0900 (JST) Message-ID: <36F661B1.5961DD3E@newsguy.com> Date: Tue, 23 Mar 1999 00:28:49 +0900 From: "Daniel C. Sobral" X-Mailer: Mozilla 4.5 [en] (Win98; I) X-Accept-Language: pt-BR,ja MIME-Version: 1.0 To: John Baldwin Cc: current@FreeBSD.ORG, "Jordan K. Hubbard" , Richard Wackerbarth Subject: Re: /etc/rc.conf, take 46! References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG John Baldwin wrote: > > >#!/bin/sh > > for file in $1 > > do > > . $file > > if [ "${rc_conf_files}X" != "$*X" ] then > > . $0 "${rc_conf_files}" > > fi > > done > > I would move the if-statemeount outside the for loop. Say config file a defines > rc_conf_files="b c", and config file b defines rc_conf_files="d". a is > executed and then b is sucked in, rc_conf_files has changed, so the function > calls itself to read in config file "d". Then the recursive call returns and > "c" is read. Thus, the files would be read in the order a, b, d, c and "c" > could possibly override customizations the user had put in d. To me the > logical order for the files to be read in would be a, b, c, d. Moving the > if-statement outside of the for loop would give the latter behavior. Other > than that it works for me. So, if b define "d", and c define "e", you'll end up not loading "d". Aside from that, I like the behavior above for the same reason you don't. :-) -- Daniel C. Sobral (8-DCS) dcs@newsguy.com dcs@freebsd.org "What happened?" "It moved, sir!" To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message