LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Grab line based on string (https://www.linuxquestions.org/questions/linux-newbie-8/grab-line-based-on-string-896408/)

DuskFall 08-09-2011 01:58 PM

Grab line based on string
 
Ok so i have a file with a lot of lines in it, and i would like to grab just the line that contains a string i've specified in a variable... Let me know if you want a sample of the file. Thanks in advance

EricTRA 08-09-2011 02:02 PM

Hello,

A sample is always the best starting point just to avoid mistakes and misunderstandings. Talking about misunderstandings, is this question the same as you asked in this thread which you marked as solved, or is it different. If different please specify how and why so that we're clear on that. If it's different in the sense that you now want to save the entire line instead of a value between tags, then have a look at my first post in that thread on how you could use grep.

Kind regards,

Eric

DuskFall 08-09-2011 02:07 PM

Sorry, my mistake... thank you

EricTRA 08-09-2011 02:08 PM

Hi,

No problem. You marked the thread as solved. Does that mean that the reference to grep I posted is what you were looking for?

Kind regards,

Eric


All times are GMT -5. The time now is 04:02 PM.