I have a file config.txt which consist of lines like below
$ cat config.txt | head -n 3
f03889d9abcb6a16155411bb8e0a34dddb5c8e4c@192.168.3.4:26601
be9d757acee1f5b573ec18d1e056542bc282be23@169.172.56.77:26604
d40ec20a080468fcd5965493d904e4d536cf5767@10.129.101.3:26607
$ cat ip.txt | head -n 3
10.0.4.5
10.3.5.6
10.3.5.8
I would like to replace the IP address on config.txt with ip's on ip.txt file respectively
the expected output is
f03889d9abcb6a16155411bb8e0a34dddb5c8e4c@10.0.4.5:26601
be9d757acee1f5b573ec18d1e056542bc282be23@10.3.5.6:26604
d40ec20a080468fcd5965493d904e4d536cf5767@10.3.5.8:26607
Since the ip's in config file are dynamic, I need to use regex in sed to replace the IP. for an example:
$ echo "f03889d9abcb6a16155411bb8e0a34dddb5c8e4c@192.168.3.4:26601" | sed "s/*@\+:*/*@10.0.4.5:*/g"
but its not updating the ip's. I am very new to the regex in scripting. Kindly help!