Solved

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

Posted on 2013-02-05
5
597 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

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…
In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

631 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