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) d...@newsguy.com d...@freebsd.org "What happened?" "It moved, sir!" To Unsubscribe: send mail to majord...@freebsd.org with "unsubscribe freebsd-current" in the body of the message