LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-06-2017, 05:42 PM   #16
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750

There is no need to invoke 'grep' here. Just use 'bash'.
To match two alphabetic characters as the pattern use [a-zA-Z][a-zA-Z] or alternatively [[:alpha:]][[:alpha:]].
To match 0 or more characters as the pattern use *.
To match "e" as the pattern use e.
To match 0 or more characters as the pattern use *.
With extended globbing enabled, to match 1 or more alphabetic characters as the pattern use +([a-zA-Z]) or alternatively +([[:alpha:]]).

Pattern matching syntax in 'bash' is different to regular expression syntax in 'grep'.

Last edited by allend; 10-06-2017 at 05:45 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Do you have an updated list of firewall rules for iptables? Gary Baker Slackware 6 05-23-2014 07:14 PM
List LS query by file size hammertime1983 Linux - Newbie 3 05-27-2013 02:38 AM
iptables --list does not show pre or postrouting rules thllgo Linux - Software 2 01-28-2010 10:25 AM
HELP/QUERY: Knoppix rules woes :S kevingpo Linux - Distributions 1 09-07-2005 01:42 PM
iptables- how to list all rules? Noerr Linux - Networking 4 06-01-2002 04:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration