I have two files
File1
filer_xxxxx_Wed_Full
/vol/vol1/qtree
....
....
File2
/vol/vol1/qtree
I want read File2 and if the line in File2 matches a line in File1 then print the line previous to matching line.
I tried with this command
for ln in `cat /tmp/File2`; do nawk -v var=$ln '/var/{print $0};{x=$0}' /tmp/File1; done
But it returns nothing, but I know there are matching condition.
Could someone help me here?
Thanks
File1
filer_xxxxx_Wed_Full
/vol/vol1/qtree
....
....
File2
/vol/vol1/qtree
I want read File2 and if the line in File2 matches a line in File1 then print the line previous to matching line.
I tried with this command
for ln in `cat /tmp/File2`; do nawk -v var=$ln '/var/{print $0};{x=$0}' /tmp/File1; done
But it returns nothing, but I know there are matching condition.
Could someone help me here?
Thanks