Date: Tue, 23 Mar 1999 00:28:49 +0900 From: "Daniel C. Sobral" <dcs@newsguy.com> To: John Baldwin <jobaldwi@vt.edu> Cc: current@FreeBSD.ORG, "Jordan K. Hubbard" <jkh@zippy.cdrom.com>, Richard Wackerbarth <rkw@dataplex.net> Subject: Re: /etc/rc.conf, take 46! Message-ID: <36F661B1.5961DD3E@newsguy.com> References: <XFMail.990322092829.jobaldwi@vt.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?36F661B1.5961DD3E>
