From owner-cvs-src@FreeBSD.ORG Sun Oct 23 12:02:28 2005 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6776516A41F; Sun, 23 Oct 2005 12:02:28 +0000 (GMT) (envelope-from stefan@fafoe.narf.at) Received: from viefep17-int.chello.at (viefep17-int.chello.at [213.46.255.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6FA6243D45; Sun, 23 Oct 2005 12:02:26 +0000 (GMT) (envelope-from stefan@fafoe.narf.at) Received: from wombat.fafoe.narf.at ([213.47.85.26]) by viefep17-int.chello.at (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with ESMTP id <20051023120224.KDY9681.viefep17-int.chello.at@wombat.fafoe.narf.at>; Sun, 23 Oct 2005 14:02:24 +0200 Received: by wombat.fafoe.narf.at (Postfix, from userid 1001) id 0F0302B2; Sun, 23 Oct 2005 14:02:22 +0200 (CEST) Date: Sun, 23 Oct 2005 14:02:22 +0200 From: Stefan Farfeleder To: Colin Percival Message-ID: <20051023120218.GB576@wombat.fafoe.narf.at> References: <200510231119.j9NBJuLF094528@repoman.freebsd.org> <435B75CD.7040903@freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="3V7upXqbjpZ4EhLz" Content-Disposition: inline In-Reply-To: <435B75CD.7040903@freebsd.org> User-Agent: Mutt/1.5.11 Cc: cvs-src@FreeBSD.org, Stefan Farfeleder , cvs-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: cvs commit: src/gnu/usr.bin/grep grep.1 X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Oct 2005 12:02:28 -0000 --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sun, Oct 23, 2005 at 04:36:45AM -0700, Colin Percival wrote: > Stefan Farfeleder wrote: > > Modified files: > > gnu/usr.bin/grep grep.1 > > Log: > > Document [:blank:]. > > The text now claims that [:alnum:], [:alpha:], [:blank:] ... [:space:] ... > are self-explanatory names. While I've managed to work out the difference > between :blank: and :space: by looking at the source code (:blank: matches > [ \t], while :space: matches [ \f\n\r\t\v] and possibly other characters > depending upon the locale), I have trouble accepting that this difference > is obvious from the names. > > Could you add some text explaining this difference? Well, I think many of those aren't really self-explanatory (eg. [:cntrl:], [:graph:], [:print:]) if you don't know the C library. Here's a patch that refers to ctype(3), though I'm not sure how to do that correctly because grep(1) isn't in mdoc format. Stefan --3V7upXqbjpZ4EhLz Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="grep.1.diff" Index: grep.1 =================================================================== RCS file: /home/ncvs/src/gnu/usr.bin/grep/grep.1,v retrieving revision 1.27 diff -I.svn -u -r1.27 grep.1 --- grep.1 23 Oct 2005 11:19:56 -0000 1.27 +++ grep.1 23 Oct 2005 11:56:11 -0000 @@ -507,7 +507,7 @@ .PP Finally, certain named classes of characters are predefined within bracket expressions, as follows. -Their names are self explanatory, and they are +They are .BR [:alnum:] , .BR [:alpha:] , .BR [:blank:] , @@ -521,13 +521,10 @@ .BR [:upper:] , and .BR [:xdigit:]. -For example, -.B [[:alnum:]] -means -.BR [0\-9A\-Za\-z] , -except the latter form depends upon the C locale and the -\s-1ASCII\s0 character encoding, whereas the former is independent -of locale and character set. +Such a character class matches a character for which the corresponding +ctype(3) function (prefixed with +.BR is ) +returns a non-zero value. (Note that the brackets in these class names are part of the symbolic names, and must be included in addition to the brackets delimiting the bracket list.) Most metacharacters lose their special meaning --3V7upXqbjpZ4EhLz--