Character classes in the C shell
You can use character classes to match file names within a range indication.
The following format instructs the system
to match any single character belonging to the specified class:
[:charclass:]The following classes correspond to ctype subroutines:
| Character Class | Definition |
|---|---|
| alnum | Alphanumeric characters |
| alpha | Uppercase and lowercase letters |
| cntrl | Control characters |
| digit | Digits |
| graph | Graphic characters |
| lower | Lowercase letters |
| Printable characters | |
| punct | Punctuation character |
| space | Space, horizontal tab, carriage return, newline, vertical tab, or form-feed character |
| upper | Uppercase characters |
| xdigit | Hexadecimal digits |
Suppose that you are in a directory containing
the following files:
a aa aax Alice b bb c ccType the following command at a C shell prompt:
ls [:lower:]The C shell lists all file names that begin
with lowercase characters:
a aa aax b bb c ccFor more information about character class expressions, see the ed command.