Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 41734 Build 38623: arc lint + arc unit
Event Timeline
libexec/rc/rc.d/sysctl | ||
---|---|---|
30 | Is there any guarantee about the order of globbing here? I took a quick look at the sh manual page but i couldn't find anything relevant right away. |
libexec/rc/rc.d/sysctl | ||
---|---|---|
30 | Apologies, I don't understand what order of globbing means. Can you elaborate? |
libexec/rc/rc.d/sysctl | ||
---|---|---|
30 | Sure! So when you run a command like echo * you are going to echo all the file names in the directory to stdout. That's something we all know. Now, I wonder if the list of matching filenames is always sorted. Usually, it is, but I'm not sure if that's a guarantee. Side note: I'd expect this to be described in subsection "Pathname Expansion (File Name Generation)" in the manual for sh(1) but it isn't. In the end, I wonder if you can control the order your /etc/sysctl.conf.d/*.conf are sourced. |
libexec/rc/rc.d/sysctl | ||
---|---|---|
30 | Oh, I see now! I ran this in FreeBSD, looks like they are string sorted. $ for _f in ./*.conf; do echo ${_f} done ./01-foo.conf ./02-bar.conf ./1-baz.conf ./10-z.conf ./12-bar.conf ./2-baz.conf ./bar.conf ./foo.conf ./z.conf |
libexec/rc/rc.d/sysctl | ||
---|---|---|
30 | POSIX requires pathname generation to sort according to the current locale's collating sequence, and FreeBSD sh and other shells implement this (although older implementations might sort by character code). This piece of information is indeed missing from the sh(1) manual page. |
Follow-up to discussion in IRC,
I think, what landed there made it easier to progress things (not necessarily close off) here.