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

Matt Alexander m at netpro.to
Wed Sep 18 21:50:36 UTC 2002


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
>






More information about the PLUG mailing list