I have two files
I need to compare these two files and take the lines that are common in both the files and consider the line present in second file for my further processing
I have used "Awk" along with "FNR and NR" but that is not working
gawk -F= '
> FNR==NR {a[NR]=$1; next};
> {b[$1]=$0}
> END{for (i in a) if (a in b) print b[a]}
> ' executed.txt org_sysctl.txt
The two files are
root@39da864625c7:/home# cat executed.txt
d.cdrom.124=1
d.cdrom.12=0
d.cdrom.122=0
d.cdrom.34=0
d.cdrom.lo=0
root@39da864625c7:/home# cat org_sysctl.txt
d.cdrom.124 = 1
d.cdrom.12 = 600
d.cdrom.122 = 400
d.cdrom.34 = 200
d.cdrom.lo = 100
v.pet = 0
v.static = 1
v.swappy = 60
v.user = 124270
v.vfs = 100
v.done = 0
I want the output as the following
d.cdrom.124 = 1
d.cdrom.12 = 600
d.cdrom.122 = 400
d.cdrom.34 = 200
d.cdrom.lo = 100
Please help