I have 2 files.
This is a string = mystringrocks This is another string = mystringrocksmore
Trying to figure out: This is a string Still trying to figure it out: This is another string
Trying to figure out: mystringrocks Still trying to figure it out: mystringrocksmore
I've tried a number of things, the most recent of which is to load the two files into an array and looping with sed.
#!/bin/bash declare -a a readarray a <filea.txt echo $a declare -a b readarray b <fileb.txt echo $b for line in 'fileb.txt'; do sed -i -- 's/$line/$a/' file.txt done
To no avail.