LinuxQuestions.org
Help answer threads with 0 replies.
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 09-05-2007, 11:35 AM   #1
karimasif
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Rep: Reputation: 0
grep command


Hi
I want to grep the pattern history[0] with in a files but I cannot although I can grep it using history word. Can any one help me in this regard.
 
Old 09-05-2007, 11:49 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374Reputation: 2374
Hi,

The square brackets around the zero are special and need to be escaped: grep 'history\[0\]' infile

Hope this helps.
 
Old 09-05-2007, 12:54 PM   #3
karimasif
LQ Newbie
 
Registered: Aug 2007
Posts: 13

Original Poster
Rep: Reputation: 0
Thanks its help .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
grep command thodo Programming 12 05-15-2007 08:07 PM
grep command sgarci Linux - General 3 08-28-2006 08:13 AM
how to use grep command sharonyiisl Linux - Newbie 7 05-28-2006 04:46 PM
grep command itz2000 Linux - Newbie 2 09-21-2005 08:06 PM
grep command cuss Linux - General 7 02-14-2003 10:23 AM


All times are GMT -5. The time now is 06:32 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration