automate editing of a template

Given two files:

File1 - source data
abc
def
ghi
File 2 - a template to be edited with data from File 1
This is a line with a @tag@ of some item A
This is a line with a @tag@ of some item B
This is a line with a @tag@ of some item C
What I want to do is substitute @tag@ with a value from File 1, so the resulting file 2 wold be
This is a line with a abc of some item A
This is a line with a dev of some item B
This is a line with a ghi of some item C
I'm comfortable with simple to moderate shell scripting. Have lots of scripts that use sed to make global change of simple values from a single, known input value, but this one has me stumped. In the above, I'm not wedded to the idea of a single @tag@, - have no problem with using @tag1@, @tag2@, etc, if it simplifies things.

Thanks for any pointers.

awk 'FILENAME=="file1" {arr[FNR]=$0; next}
       FILENAME=="file2" {sub("@tag@", arr[FNR], $0);  print}' file1  file2 > newfile 

Perfect! Thanks for the quick reply. Now I'll be spending the rest of the afternoon parsing through it to understand how it works. Always trying to expand my understanding.

It's fairly simple once you know what the special variables are. FILENAME is a special variable meaning the current file being read by awk. FNR is a special variable meaning 'line number', relative to the current file. (NR would be the total number of lines from all files processed so far.) $0 is the current line.

arr is just an array with strings being put in it for each line. Once the second file gets read, it substitutes strings from that array into the lines being read, then prints them back out.

awk '
# For each line, test whether the current FILENAME is file1.
# When it is, store arr[line number]=line.
# Then skip to the next line.
FILENAME=="file1" {arr[FNR]=$0; next}

# For each line, test whether the current FILENAME is file2.
# When it is, substitute arr[line number] for @tag@, then print.
FILENAME=="file2" {sub("@tag@", arr[FNR], $0);  print}' file1 file2 > file3