Reputation: 1615
I am getting confused between following wildcard characters
Please explain how following commands are working?
Upvotes: 0
Views: 30
Reputation: 299455
[:upper:]
means "one of the characters of :, u, p, e, or r." Your first example finds the one thing that ends in e.
[[:upper:]]
means "one of the characters in the upper
class." Your pattern matches the one thing that ends in an upper case letter.
Your third example matches anything with at least one upper case letter in it.
From bash(1)
:
Within [ and ], character classes can be specified using the
syntax [:class:], where class is one of the following classes
defined in the POSIX standard:
alnum alpha ascii blank cntrl digit graph lower print punct
space upper word xdigit
A character class matches any character belonging to that class.
The word character class matches letters, digits, and the char-
acter _.
Note the "Within [ and ]...the syntax [:class:]..."
Upvotes: 2