Skip to Content
SSH, The Secure Shell: The Definitive Guide, 2nd Edition
book

SSH, The Secure Shell: The Definitive Guide, 2nd Edition

by Daniel J. Barrett, Richard E. Silverman, Robert G. Byrnes
May 2005
Intermediate to advanced
666 pages
21h 5m
English
O'Reilly Media, Inc.
Book available
Content preview from SSH, The Secure Shell: The Definitive Guide, 2nd Edition

Character Sets for Egrep and ZSH_FILEGLOB

A character set starts with [ and ends at non-escaped ] that is not part of a POSIX character set specifier and that does not follow immediately after [.

The following characters have a special meaning and need to be escaped if meant literally:

- (minus sign)

A range operator, except immediately after [ where it loses its special meaning.

^ or ! (latter applies to ZSH_FILEGLOB)

If immediately after the starting [, denotes a complement: the whole character set will be complemented. Otherwise, literal.

[:alnum:]

Characters for which isalnum returns true (see ctype.h).

[:alpha:]

Characters for which isalpha returns true (see ctype.h).

[:cntrl:]

Characters for which iscntrl returns true (see ctype.h).

[:digit:]

Characters for which isdigit returns true (see ctype.h).

[:graph:]

Characters for which isgraph returns true (see ctype.h).

[:lower:]

Characters for which islower returns true (see ctype.h).

[:print:]

Characters for which isprint returns true (see ctype.h).

[:punct:]

Characters for which ispunct returns true (see ctype.h).

[:space:]

Characters for which isspace returns true (see ctype.h).

[:upper:]

Characters for which isupper returns true (see ctype.h).

[:xdigit:]

Characters for which isxdigit returns true (see ctype.h).

Example

    [[:xdigit:]XY]

is typically equivalent to:

    [0123456789ABCDEFabcdefXY] .

It is also possible to include the predefined escaped character sets into a newly defined one, so:

    [\d\s]

matches digits and whitespace characters.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Basics for Hackers

Linux Basics for Hackers

OccupyTheWeb .

Publisher Resources

ISBN: 0596008953Errata Page