Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-02-05
5
Medium Priority
?
611 Views
Last Modified: 2013-02-05
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]#
0
Comment
Question by:Hoboly
  • 2
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
Kent Dyer earned 2000 total points
ID: 38854864
Have a look here under Character Classes..

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

This should help.

Kent
0
 
LVL 9

Expert Comment

by:oheil
ID: 38854874
It should be:

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

Oli
0
 

Author Closing Comment

by:Hoboly
ID: 38854876
haha~ my careless mistake.Thanks~
0
 

Author Comment

by:Hoboly
ID: 38854886
oops. sorry  oheil, I didn't see you before I close
0
 
LVL 9

Expert Comment

by:oheil
ID: 38854888
No problem :-)
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question