Using a Loop to replace a single phrase with different phrases from a list
===

Working in the shell I would like to take all instances of "replace_me" in my text file (table), and replace it with values in another file (markers), working incrementally down the list.

i.e. the first instance of "replace_me" in table would get replaced by "replaced_1" from markers, the second by "replaced_2" until the list was exhausted.

Looking around other answers I think it would have to be something like a nested loop (for, and then if), along these lines but I'm not sure how to make it actually work, and move incrementally down the 'markers' list.


    #!/bin/bash
    fileReplace='markers'
    fileChange='table'
    linesreplace=`cat $fileReplace`
    lineschange=`cat $fileChange`
    
    for line in $lineschange ; do

    if $linechange = "replace_me"
    sed "s/{$lineschange}/{$linesreplace}/g" 
    else   
    done

I'm sure this is basic so pointers in the right direction, or examples are very welcome.
Thank you