devd problem with 9-stable

Oliver Fromme olli at lurza.secnetix.de
Fri Jun 15 19:06:35 UTC 2012


Freddie Cash wrote:
 > On Fri, Jun 15, 2012 at 11:45 AM, Oliver Fromme <olli at lurza.secnetix.de> wrote:
 > > Chuck Swiger wrote:
 > >  > On Jun 15, 2012, at 11:23 AM, Oliver Fromme wrote:
 > >  > > You can try to prepend a backslash, i.e. echo \$devnum.  This
 > >  > > isn't documented, but then again, using backslashes to continue
 > >  > > strings that span multiple lines isn't documented either.
 > >  >
 > >  > Line continuations and escaping special chars like $ are in "man sh":
 > > 
 > > Yes, I know that, but the question is how devd(8) parses the
 > > action strings.
 > > 
 > > The problem here is that we have multiple levels or parsing.
 > > First, devd reads the line, concatenates continuation lines
 > > (apparently -- it's not documented), expands devd variables,
 > > and *then* it passes the resulting string to the shell for
 > > further parsing and processing.
 > 
 > If you have that many levels of backticks, variable expansions,
 > programs, etc, wouldn't it be a prime candidate for a script?  Just
 > pass in a couple of variables directly from devd, and then do
 > everything else inside the script?

Yes, that might be better.  At least, the shell parser is
much better documented than the devd parser, so it makes
sense to make the action line as simple as possible.

I also think it is a mistake to use dollar signs for
variable expansion in devd.conf, because the shell uses
the same character for the same thing, so it causes
confusion.  It's just like in Makefiles; I also keep
forgetting to double the dollar signs for shell variables
in Makefiles ...

Best regards
   Oliver


-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"Being really good at C++ is like being really good
at using rocks to sharpen sticks."
        -- Thant Tessman


More information about the freebsd-stable mailing list