Solved

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

Posted on 2013-02-05
5
585 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 500 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

786 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