Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find the First and the Last file in the list

Status
Not open for further replies.

vladab

Programmer
Aug 13, 2002
13
US
Hello,

I have a list of files. I need to look in the first file and grep for a certain expression. I also need to look in the last file to look for a different expression.

Can you suggest the best way to do it?
I am getting the list of file names as a result of grep. How can I find what is the first and what is last the last (word?) in this result. I guess I have to pass it to two variables for further use.

Please suggest.
Thank you.

Vlada
 
man head
man tail

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Works like a charm!

Thank you for your help, PH!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top