From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 9 23:28:58 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 611EE106566C for ; Tue, 9 Feb 2010 23:28:58 +0000 (UTC) (envelope-from brampton@gmail.com) Received: from mail-fx0-f224.google.com (mail-fx0-f224.google.com [209.85.220.224]) by mx1.freebsd.org (Postfix) with ESMTP id E767D8FC13 for ; Tue, 9 Feb 2010 23:28:57 +0000 (UTC) Received: by fxm24 with SMTP id 24so60120fxm.3 for ; Tue, 09 Feb 2010 15:28:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=2s4DL1+aLY535z9DvtMz3gNSr5PwrgmV/ImLTX8CSvQ=; b=boTvSr5Elfevqi6o4NetR2SWbhMR04o90Ui9F2DAaPFW1lvazxSeNFX4FN4fYuha4D 8ajLo3G/8XVX+lNTKGNi4t+CNO72NkE0MKKb+RmSI22FpbrGTAbufqjiWbXMAIuA8TGt ew7EjPc2CiwrnlbfeooW1Wmw1kiiasQq/mfpY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=NpbxegZRB6jWnAGpziPgOIDL++vndAB6BuXKu7GVpCADa+LPqwf303CaMlB2B+ILoX Q0Nc33WdWxmoY5bQD2yS3tLDL9830hjnxaa7A6wu1rh6oCmt9qO70VaA5d42lyFYtzyH nWAmshohU7a0PRpy/4dIPwxHO3daCn0lXC49g= MIME-Version: 1.0 Sender: brampton@gmail.com Received: by 10.223.64.84 with SMTP id d20mr897701fai.76.1265758133319; Tue, 09 Feb 2010 15:28:53 -0800 (PST) In-Reply-To: <86tytqvwky.fsf@ds4.des.no> References: <86tytqvwky.fsf@ds4.des.no> Date: Tue, 9 Feb 2010 23:28:53 +0000 X-Google-Sender-Auth: eeff3e5638ab58da Message-ID: From: Andrew Brampton To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Tue, 09 Feb 2010 23:34:55 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: sysctl with regex? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Feb 2010 23:28:58 -0000 2010/2/9 Dag-Erling Sm=C3=B8rgrav : > Andrew Brampton 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