[PLUG] How to pull out a particular line from a textfile

Richard Langis richard.langis at sun.com
Wed Sep 18 21:59:56 UTC 2002


Yeah, I was thinking that the EMAIL and SUBJECT would be in the text 
file as well, not fully comprehending exactly what you were wanting.

Sorry.  :)

-R

Matt Alexander wrote:
> No...  because the email will change and it's possible it could appear on
> a different line as well.  I have to be sure I'm only storing line 2 in
> that particular variable.  I'll use the head/tail combo suggested.
> Thanks,
> ~M
> 
> 
> On Wed, 18 Sep 2002, Richard Langis wrote:
> 
> 
>>What, like: grep EMAIL file.txt
>>
>>Matt Alexander wrote:
>>
>>>I've got a file and I want to write a script to pull out particular lines
>>>and save them in variables.  Line 1 is always the email address and Line 2
>>>is always the subject, for example.
>>>
>>>#!/bin/bash
>>>
>>>EMAIL=`some magical way to pull out line 1 from a textfile`
>>>SUBJECT=`some magical way to pull out line 2 from a textfile`
>>>
>>>
>>>I assume there's a simple command to pull out a particular line from a
>>>textfile, but I can't think of anything right now.
>>>Thanks,
>>>~M
>>
>>
>>_______________________________________________
>>PLUG mailing list
>>PLUG at lists.pdxlinux.org
>>http://lists.pdxlinux.org/mailman/listinfo/plug
>>
> 
> 
> 
> 
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug






More information about the PLUG mailing list