sysctl with regex?
Andrew Brampton
brampton+freebsd at gmail.com
Tue Feb 9 23:28:58 UTC 2010
2010/2/9 Dag-Erling Smørgrav <des at des.no>:
> Andrew Brampton <brampton+freebsd at gmail.com> writes:
>> Today I was writing a script to read all the dev.cpu.?.temperature
>> sysctl OIDs. I was parsing them using a simple grep, but it occurred
>> to me it might be better if sysctl supported some form of regexp.
>
> You mean glob, not regexp...
Could you explain why do I mean glob instead or regexp?
Is glob simple matches, ie * and ?
and regexp more complex like [a-z]*
>> For example instead of typing:
>> sysctl -a | grep dev.cpu.*.temperature
>>
>> I could write:
>> sysctl dev.cpu.*.temperature
>
> Sounds like a good idea. Shouldn't be too hard to implement either.
If I get time I might submit a patch.
Thanks
Andrew
More information about the freebsd-hackers
mailing list