I am trying to use the diff command on multiple files. I have a script like this:
diff -u <(head -n99999999 /tmp/*txt ) <(head -n99999999 *txt.z) |sed -e '/\-\//s/\-/deleting /g' -e '/\+\//s/\+/rearranging /g' -e '/=\//s/\.*//g' -e '/txt.z/d' -e '/@/d' |gawk '$1 ~ /^deleting$/ || $1 ~ /^rearranging$/ || $1 ~ /==/ {print}' |gawk '/[txt]/{x="F"++i;}{print > x;}'
The script works and creates F* files but the problem is that some items are marked as "deleting" which should not be. I found that when I run one file at a time it works fine:
diff -u <(head -n99999999 /tmp/product-txt ) <(head -n99999999 /tmp/product-txt.z)
I am wondering how to feed two files into the diff command at a time. I have tried multiple commands, such as paste (but I have over 12 files) and also tried using
sed -n "$count"p
in a script without success. I am sure that there is a read "script" that could be used with diff that would do it but I can't figure it out.
I really just need two files, one from txt and one from txt.z read into the diff command one at a time to compare the differences. Then the script should move on to the next pair. Ordinary diff doesn't work it will just run a check on 2 files and that's it. That is why I was using head -n999999.