[CentOS] script help

Thu Jun 18 10:29:10 UTC 2009
Mfawa Alfred Onen <muffycompoqm at gmail.com>

Dear Chloe,
  John Doe`s script is a good start, even though it will work for single
words space separated. The LINE Variable only passes the Arguments as single
words to ($1 and $2 respectively). I will also work on something for you
too...

On Thu, Jun 18, 2009 at 10:34 AM, John Doe <jdmls at yahoo.com> wrote:

>
> From: chloe K <chloekcy2000 at yahoo.ca>
> > I have a file. list.txt (two columns)
> >
> > column1    column2
> > name        address
> >
> > I need to put in the letter file letter.txt eg:
> >
> > Dear: Chloe
> > Address: CA
> >
> > Can I use this
> >
> > for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g' $i.letter.txt
>
> For single words space separated:
>
>  cat list.txt | while read LINE
>    do
>      set $LINE
>      printf "Dear: %s\nAddress: %s\n" $1 $2 >> $1.letter.txt
>    done
>
> JD
>
>
>
>
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20090618/b7bd956c/attachment-0005.html>