LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-28-2007, 05:22 PM   #16
wendea
Member
 
Registered: Mar 2007
Distribution: Fedora
Posts: 81

Rep: Reputation: 15

grep FILENAME | cathy* - does that work?
 
Old 05-28-2007, 05:44 PM   #17
baks
Member
 
Registered: Feb 2007
Posts: 41

Original Poster
Rep: Reputation: 15
Thank you thank you to everyone but I realised that I could use a combination of head and tail as the following:
INSTANCE=`grep $N $FILE | head -n $COUNT1 | tail -n 1`

As long as I increment the count variable and echo the instance variable with a number and bracket it works.

Thank and I know that I will be back.
 
  


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
grep problem spx2 Linux - Newbie 9 12-15-2005 01:22 AM
grep problem michaelsanford Linux - Software 2 05-20-2005 07:23 PM
Grep problem chup Linux - General 7 04-17-2004 12:08 AM
ps -ef|grep -v root|grep apache<<result maelstrombob Linux - Newbie 1 09-24-2003 11:38 AM
PERL: problem with grep ocularbob Programming 9 05-01-2003 05:36 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:52 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