Julian Foad <[EMAIL PROTECTED]> writes: > I don't think the Grep manual should say explicitly how to do that > particular thing.
I disagree. I think it'd be useful to have a simple pattern that tests for ASCII characters (i.e., bytes in the range 00 through 7F). I myself needed such a pattern in the last couple of days, when I mentioned to Andrew Josey of the Open Group that some of their published text documents contained non-ASCII characters, and he responded "How can I easily check for this?". I ended up telling him "LC_ALL=C grep '[^[:space:][:print:]]'", which (1) is not quite correct, and (2) is far less convenient than "grep '[[:ascii:]]'" would be. > I'm not sure what the definition of "ASCII" is in this case The standard one. See <http://en.wikipedia.org/wiki/ASCII>. > Does the following command do what you want? > > grep '[ -~]' That isn't correct, first because it's not portable outside the C locale, and second because it doesn't match the 33 ASCII control characters.
