Solved

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

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Write a function 5 26
SQL Select Query help 3 32
SQL Help - 12 42
SQL Server 2008 R2 - Updating Table/Fields Documentation 3 29
You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now