bash shell grep problem, how come [a-zA-Z] doesn't work?

how come [a-zA-Z] doesn't work?

[root@www sdb2]# last | grep a | wc
     50     468    3810
[root@www sdb2]# last | grep [a-zA-Z] | wc
      0       0       0
[root@www sdb2]#
HobolyAsked:
Who is Participating?
 
Kent DyerIT Security Analyst SeniorCommented:
Have a look here under Character Classes..

http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_04_02.html

This should help.

Kent
0
 
oheilCommented:
It should be:

last | grep "[a-zA-Z]" | wc

Oli
0
 
HobolyAuthor Commented:
haha~ my careless mistake.Thanks~
0
 
HobolyAuthor Commented:
oops. sorry  oheil, I didn't see you before I close
0
 
oheilCommented:
No problem :-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.