# Pastebin cG4ksCZ9 # Q: are files in lib2 contained in lib? # below has 34 files ls -1 --color=none ../foo/lib2/ > /tmp/lib2.txt # below has 166 files ls -1 --color=none lib/ > /tmp/lib.txt # Find what files if any in lib2 are contained in lib git diff --color=never --word-diff /tmp/lib{2,}.txt | egrep '^\w' | sed -n '3,$p' > /tmp/libs_common_to_both_libs_and_lib2.txt # raw git diff output (with line #s) looks something like: # 1 diff --git a/tmp/lib2.txt b/tmp/lib.txt # 2 index 6407082..4a23e01 100644 # 3 --- a/tmp/lib2.txt # 4 +++ b/tmp/lib.txt # 5 @@ -1,5 +1,74 @@ # 6 {+foo-1.14.jar+} # 7 bar-2.3.jar # 8 {+baz-3.14.jar+} # ... # egrep filters out all lines that don't begin with a word char (2-4,5,7,etc.) # the sed command is to strip header (1-2) # compare what's common to both with original lib2 list to find what's extra git diff --color=never --word-diff /tmp/lib{s_common_to_both_libs_and_lib2,2}.txt # raw git diff output (with line #s) looks something like: # 1 diff --git a/tmp/libs_common_to_both_libs_and_lib2.txt b/tmp/lib.txt # 2 index 6407082..4a23e01 100644 # 3 --- a/tmp/libs_common_to_both_libs_and_lib2.txt # 4 +++ b/tmp/lib.txt # 5 @@ -1,5 +1,74 @@ # 6 {+foo-1.14.jar+} # 7 bar-2.3.jar # 8 {+baz-3.14.jar+} # ... # files prefixed with {+ == files that are missing from lib2 list?