Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 9 Feb 2010 23:28:53 +0000
From:      Andrew Brampton <brampton+freebsd@gmail.com>
To:        =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= <des@des.no>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: sysctl with regex?
Message-ID:  <d41814901002091528i4884987cmb7347dfe4d50bdc5@mail.gmail.com>
In-Reply-To: <86tytqvwky.fsf@ds4.des.no>
References:  <d41814901002091308s7e894b55p880bde165bbbe703@mail.gmail.com> <86tytqvwky.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
2010/2/9 Dag-Erling Sm=C3=B8rgrav <des@des.no>:
> Andrew Brampton <brampton+freebsd@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. =C2=A0Shouldn't be too hard to implement either.

If I get time I might submit a patch.

Thanks
Andrew



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d41814901002091528i4884987cmb7347dfe4d50bdc5>