Page MenuHomeFreeBSD

devd.conf(5): explain internal vs. shell variables
AcceptedPublic

Authored by joerg on Dec 19 2024, 10:47 PM.
Tags
Referenced Files
Unknown Object (File)
Mon, Jan 27, 2:23 PM
Unknown Object (File)
Jan 10 2025, 7:14 AM
Unknown Object (File)
Dec 26 2024, 11:36 AM
Unknown Object (File)
Dec 26 2024, 7:48 AM
Unknown Object (File)
Dec 26 2024, 7:44 AM
Unknown Object (File)
Dec 25 2024, 10:36 PM
Unknown Object (File)
Dec 21 2024, 5:00 PM
Unknown Object (File)
Dec 20 2024, 8:21 PM
Subscribers

Details

Summary

devd.conf by default considers many variables as internal, possibly expanding them to an empty string.
shell variables thus need to be wrapped into braces.

Test Plan

Eyeball review needed.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

This revision is now accepted and ready to land.Dec 19 2024, 10:57 PM

Fine with me, but please check my comments.

sbin/devd/devd.conf.5
700

Should we write "Any text immediately following that..."?

And can a var really start with a minus sign? If yes, and there are just no vars starting with '-' at the moment, please ignore this comment.

joerg marked an inline comment as done.

Updated to reflect Andre's comments.

This revision now requires review to proceed.Dec 20 2024, 8:14 PM
joerg added inline comments.
sbin/devd/devd.conf.5
700

OK

The asterisk and the minus sign form special variables. This is explained at the beginning of the "Variables" subsection.

This revision is now accepted and ready to land.Dec 20 2024, 8:33 PM

The asterisk and the minus sign form special variables.

That's what I thought as well. But what's mentioned in the manpage are asterisk and underscore ;-).

The asterisk and the minus sign form special variables.

That's what I thought as well. But what's mentioned in the manpage are asterisk and underscore ;-).

I correct myself: asterisk and underscore form special variables. However, minus signs are legal parts of any internal variable identifier, thus they are also allowed at the beginning of a name.

So in essence, $-foo, $_foo, and $*foo are all considered internal variables, undergoing normal variable replacement inside devd.
${mumble, $$$, $[ (to just name a few things) are all passed to the shell.