On Wed, Jun 17, 2009 at 10:54 AM, chloe K<chloekcy2...@yahoo.ca> wrote:
> Hi
>
> 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
>

I've never seen any shell or sed syntax that allows you to subscript a
line like this.  You should read up on awk, although there is no
simple way to do dual file processing along these lines.  (An awk
script for this would need to know it has two files to process and
read in the first one, then print it with replacements from the second
one.)

Also, if the above were to work, it would be "for i in `cat...." - the
"in" is part of "for" syntax....

Man pages are really handy for this sort of thing....

HTH

mhr
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos

Reply via email to