Search Results

Search: Posts Made By: Mojing
23,605
Posted By Scrutinizer
With a quick minor adaptation: awk 'getline...
With a quick minor adaptation:

awk 'getline p<f && /^X/ && p!=$0 {print "Line " NR ":" RS $0 RS p; exit}' f=file2 file1

But now there are more exceptions to consider, for example, are the...
23,605
Posted By Scrutinizer
A quick start would be: awk 'getline p<f &&...
A quick start would be:
awk 'getline p<f && p!=$0 {print "Line " NR ":" RS $0 RS p; exit}' f=file2 file1

But you would need to add provisions for if file1 has more lines than file2 or vice versa
23,605
Posted By Jotne
I am 100% sure you can do this easy with awk, but...
I am 100% sure you can do this easy with awk, but I have not worked much with array.
There you can add an exit if diff found.
36,578
Posted By Neo
Featured Books and Articles by Active Forum Members
The UNIX and Linux Forums have a number of active members that have published books or papers related to shell programming and scripting. You can check out their publications here:

Link Removed
...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 02:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy