#cat hwlock-full.dep
libx11-6 >= 1.4.4
libz1 >= 1.2.7
libtinfo5 >= 5.9
libxcb1 >= 1.8.1
numactl >= 2.0.8+rc4
libpixman-1-0 >= 0.29.2
libxml2 >= 2.7.8
libxext6 >= 1.3.1
libxrender1 >= 0.9.7
libfreetype6 >= 2.4.9
libxcb-render0 >= 1.8.1
libcairo2 >= 1.12.14
libc6 >= 2.15
libxcb-shm0 >= 1.8.1
libxdmcp6 >= 1.1.1
libxau6 >= 1.0.7
libexpat1 >= 2.0.1
libpciaccess0 >= 0.12.902
libpng12-0 >= 1.2.49
libfontconfig1 >= 2.8.0
libx11-6 >= 1.4.4
libz1 >= 1.2.7
libtinfo5 >= 5.9
libxcb1 >= 1.8.1
numactl >= 2.0.8+rc4
libpixman-1-0 >= 0.29.2
libxml2 >= 2.7.8
libxext6 >= 1.3.1
libxrender1 >= 0.9.7
libfreetype6 >= 2.4.9
libxcb-render0 >= 1.8.1
libcairo2 >= 1.12.14
libc6 >= 2.15
libxcb-shm0 >= 1.8.1
libxdmcp6 >= 1.1.1
libxau6 >= 1.0.7
libexpat1 >= 2.0.1
libpciaccess0 >= 0.12.902
libpng12-0 >= 1.2.49
libfontconfig1 >= 2.8.0
/bin/sh
rtld(GNU_HASH)
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libpciaccess.so.0()(64bit)
libnuma.so.1()(64bit)
libdl.so.2()(64bit)
libxml2.so.2()(64bit)
libhwloc.so.5()(64bit)
libz.so.1()(64bit)
libm.so.6()(64bit)
/bin/sh
libc.so.6(GLIBC_2.3)(64bit)
libxcb-shm.so.0()(64bit)
libXau.so.6()(64bit)
libX11.so.6()(64bit)
libXrender.so.1()(64bit)
libpixman-1.so.0()(64bit)
libXdmcp.so.6()(64bit)
libfontconfig.so.1()(64bit)
libxcb-render.so.0()(64bit)
librt.so.1()(64bit)
libpthread.so.0(GLIBC_2.2.5)(64bit)
libfreetype.so.6()(64bit)
libtinfo.so.5()(64bit)
libexpat.so.1()(64bit)
libxcb.so.1()(64bit)
libpng12.so.0()(64bit)
libcairo.so.2()(64bit)
libpthread.so.0()(64bit)
libm.so.6(GLIBC_2.2.5)(64bit)
libXext.so.6()(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libxml2.so.2(LIBXML2_2.6.0)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libnuma.so.1(libnuma_1.2)(64bit)
libnuma.so.1(libnuma_1.1)(64bit)
libxml2.so.2(LIBXML2_2.4.30)(64bit)
libc.so.6(GLIBC_2.7)(64bit)
cat hwlock.dep
libx11-6 >= 1.4.4
libz1 >= 1.2.7
libtinfo5 >= 5.9
libxcb1 >= 1.8.1
numactl >= 2.0.8+rc4
libpixman-1-0 >= 0.29.2
libxml2 >= 2.7.8
libxext6 >= 1.3.1
libxrender1 >= 0.9.7
libfreetype6 >= 2.4.9
libcairo2 >= 1.12.14
libc6 >= 2.15
libxcb-shm0 >= 1.8.1
libxau6 >= 1.0.7
libexpat1 >= 2.0.1
libpciaccess0 >= 0.12.902
libpng12-0 >= 1.2.49
libfontconfig1 >= 2.8.0
libx11-6 >= 1.4.4
libz1 >= 1.2.7
libtinfo5 >= 5.9
libxcb1 >= 1.8.1
numactl >= 2.0.8+rc4
libpixman-1-0 >= 0.29.2
libxml2 >= 2.7.8
libxext6 >= 1.3.1
libxrender1 >= 0.9.7
libfreetype6 >= 2.4.9
libxcb-render0 >= 1.8.1
libcairo2 >= 1.12.14
libc6 >= 2.15
libxcb-shm0 >= 1.8.1
libxdmcp6 >= 1.1.1
libxau6 >= 1.0.7
libexpat1 >= 2.0.1
libpng12-0 >= 1.2.49
libfontconfig1 >= 2.8.0
rtld(GNU_HASH)
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libpciaccess.so.0()(64bit)
libnuma.so.1()(64bit)
libdl.so.2()(64bit)
libxml2.so.2()(64bit)
libhwloc.so.5()(64bit)
libz.so.1()(64bit)
libm.so.6()(64bit)
/bin/sh
libc.so.6(GLIBC_2.3)(64bit)
libXau.so.6()(64bit)
libX11.so.6()(64bit)
libXrender.so.1()(64bit)
libpixman-1.so.0()(64bit)
libXdmcp.so.6()(64bit)
libfontconfig.so.1()(64bit)
libxcb-render.so.0()(64bit)
librt.so.1()(64bit)
libpthread.so.0(GLIBC_2.2.5)(64bit)
libfreetype.so.6()(64bit)
libtinfo.so.5()(64bit)
libexpat.so.1()(64bit)
libxcb.so.1()(64bit)
libpng12.so.0()(64bit)
libcairo.so.2()(64bit)
libpthread.so.0()(64bit)
libm.so.6(GLIBC_2.2.5)(64bit)
libXext.so.6()(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libxml2.so.2(LIBXML2_2.6.0)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libnuma.so.1(libnuma_1.2)(64bit)
libnuma.so.1(libnuma_1.1)(64bit)
libxml2.so.2(LIBXML2_2.4.30)(64bit)
libc.so.6(GLIBC_2.7)(64bit)
I want to out put below data to report.dep
hwlock requires:
------------------------------
libxcb-render0 = 1.8.1
libxdmcp6 = 1.1.1
libpciaccess0 = 0.12.902
/bin/sh
libxcb-shm.so.0()(64bit)
-------------------------------
(rules: the output is in hwlock-full.dep but not in hwlock.dep)
awk 'NR==FNR{a[$0]++;next}(!a[$0])' hwlock.dep hwlock-full.dep > report.dep
I did a try, this doesn't output all the missing line
---------- Post updated at 12:36 AM ---------- Previous update was at 12:31 AM ----------
yanglei_fage:
#cat hwlock-full.dep
libx11-6 >= 1.4.4
libpciaccess0 >= 0.12.902
libpng12-0 >= 1.2.49
libfontconfig1 >= 2.8.0
/bin/sh
rtld(GNU_HASH)
libhwloc.so.5()(64bit)
libz.so.1()(64bit)
libm.so.6()(64bit)
/usr/bin/expect
libc.so.6(GLIBC_2.7)(64bit)
cat hwlock.dep
libx11-6 >= 1.4.4
libpng12-0 >= 1.2.49
libfontconfig1 >= 2.8.0
/bin/sh
rtld(GNU_HASH)
libz.so.1()(64bit)
libm.so.6()(64bit)
libc.so.6(GLIBC_2.7)(64bit)
I want to out put below data to report.dep
hwlock requires:
------------------------------
libpciaccess0 >= 0.12.902
libhwloc.so.5()(64bit)
/usr/bin/expect
-------------------------------
(rules: libpciaccess0 >= 0.12.902 libhwloc.so.5()(64bit) /usr/bin/expect in hwlock-full.dep but not in hwlock.dep)
let me try again I just did a another try
file1
libx11-6 >= 1.4.4
libz1 >= 1.2.7
libtinfo5 >= 5.9
libxcb1 >= 1.8.1
numactl >= 2.0.8+rc4
libpixman-1-0 >= 0.29.2
libxml2 >= 2.7.8
libxext6 >= 1.3.1
libxrender1 >= 0.9.7
libfreetype6 >= 2.4.9
libcairo2 >= 1.12.14
libc6 >= 2.15
libxcb-shm0 >= 1.8.1
libxau6 >= 1.0.7
libexpat1 >= 2.0.1
libpciaccess0 >= 0.12.902
libpng12-0 >= 1.2.49
libfontconfig1 >= 2.8.0
libx11-6 >= 1.4.4
libz1 >= 1.2.7
libtinfo5 >= 5.9
libxcb1 >= 1.8.1
numactl >= 2.0.8+rc4
libpixman-1-0 >= 0.29.2
libxml2 >= 2.7.8
libxext6 >= 1.3.1
libxrender1 >= 0.9.7
libfreetype6 >= 2.4.9
libxcb-render0 >= 1.8.1
libcairo2 >= 1.12.14
libc6 >= 2.15
libxcb-shm0 >= 1.8.1
libxdmcp6 >= 1.1.1
libxau6 >= 1.0.7
libexpat1 >= 2.0.1
libpng12-0 >= 1.2.49
libfontconfig1 >= 2.8.0
rtld(GNU_HASH)
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libpciaccess.so.0()(64bit)
libnuma.so.1()(64bit)
libdl.so.2()(64bit)
libxml2.so.2()(64bit)
libhwloc.so.5()(64bit)
libz.so.1()(64bit)
libm.so.6()(64bit)
/bin/sh
libc.so.6(GLIBC_2.3)(64bit)
libXau.so.6()(64bit)
libX11.so.6()(64bit)
libXrender.so.1()(64bit)
libpixman-1.so.0()(64bit)
libXdmcp.so.6()(64bit)
libfontconfig.so.1()(64bit)
libxcb-render.so.0()(64bit)
librt.so.1()(64bit)
libpthread.so.0(GLIBC_2.2.5)(64bit)
libfreetype.so.6()(64bit)
libtinfo.so.5()(64bit)
libexpat.so.1()(64bit)
libxcb.so.1()(64bit)
libpng12.so.0()(64bit)
libcairo.so.2()(64bit)
libpthread.so.0()(64bit)
libm.so.6(GLIBC_2.2.5)(64bit)
libXext.so.6()(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libxml2.so.2(LIBXML2_2.6.0)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libnuma.so.1(libnuma_1.2)(64bit)
libnuma.so.1(libnuma_1.1)(64bit)
libxml2.so.2(LIBXML2_2.4.30)(64bit)
libc.so.6(GLIBC_2.7)(64bit)
file-full
libx11-6 >= 1.4.4
libz1 >= 1.2.7
libtinfo5 >= 5.9
libxcb1 >= 1.8.1
numactl >= 2.0.8+rc4
libpixman-1-0 >= 0.29.2
libxml2 >= 2.7.8
libxext6 >= 1.3.1
libxrender1 >= 0.9.7
libfreetype6 >= 2.4.9
libxcb-render0 >= 1.8.1
libcairo2 >= 1.12.14
libc6 >= 2.15
libxcb-shm0 >= 1.8.1
libxdmcp6 >= 1.1.1
libxau6 >= 1.0.7
libexpat1 >= 2.0.1
libpciaccess0 >= 0.12.902
libpng12-0 >= 1.2.49
libfontconfig1 >= 2.8.0
libx11-6 >= 1.4.4
libz1 >= 1.2.7
libtinfo5 >= 5.9
libxcb1 >= 1.8.1
numactl >= 2.0.8+rc4
libpixman-1-0 >= 0.29.2
libxml2 >= 2.7.8
libxext6 >= 1.3.1
libxrender1 >= 0.9.7
libfreetype6 >= 2.4.9
libxcb-render0 >= 1.8.1
libcairo2 >= 1.12.14
libc6 >= 2.15
libxcb-shm0 >= 1.8.1
libxdmcp6 >= 1.1.1
libxau6 >= 1.0.7
libexpat1 >= 2.0.1
libpciaccess0 >= 0.12.902
libpng12-0 >= 1.2.49
libfontconfig1 >= 2.8.0
/bin/sh
rtld(GNU_HASH)
libc.so.6()(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libpciaccess.so.0()(64bit)
libnuma.so.1()(64bit)
libdl.so.2()(64bit)
libxml2.so.2()(64bit)
libhwloc.so.5()(64bit)
libz.so.1()(64bit)
libm.so.6()(64bit)
/bin/sh
libc.so.6(GLIBC_2.3)(64bit)
libxcb-shm.so.0()(64bit)
libXau.so.6()(64bit)
libX11.so.6()(64bit)
libXrender.so.1()(64bit)
libpixman-1.so.0()(64bit)
libXdmcp.so.6()(64bit)
libfontconfig.so.1()(64bit)
libxcb-render.so.0()(64bit)
librt.so.1()(64bit)
libpthread.so.0(GLIBC_2.2.5)(64bit)
libfreetype.so.6()(64bit)
libtinfo.so.5()(64bit)
libexpat.so.1()(64bit)
libxcb.so.1()(64bit)
libpng12.so.0()(64bit)
libcairo.so.2()(64bit)
libpthread.so.0()(64bit)
libm.so.6(GLIBC_2.2.5)(64bit)
libXext.so.6()(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libxml2.so.2(LIBXML2_2.6.0)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libnuma.so.1(libnuma_1.2)(64bit)
libnuma.so.1(libnuma_1.1)(64bit)
libxml2.so.2(LIBXML2_2.4.30)(64bit)
libc.so.6(GLIBC_2.7)(64bit)
It doesn't get the right results
---------- Post updated at 02:39 AM ---------- Previous update was at 12:36 AM ----------
I changed my file content in the question, it doesn't get the expect results
what is the basis of desire result please explain.
i thought you need the missing lines.
correct, I want get the missing line
Lei
Try
$ grep -v -f file1 fullfile
seems your mothd is not correct sometimes, seems diff can get what I want
eg:
lyang0@ovpovp-LH-Pass:/buildarea2/lyang0/ovp-test/ldd-logs/tmp$ diff openvswitch-1.10.0-r4.dep openvswitch-1.10.0-r4-full.dep
19a20
> libc.so.6(GLIBC_2.14)(64bit)
24a26
> libssl.so.1.0.0(OPENSSL_1.0.0)(64bit)
31a34
> /usr/bin/python
but your mothed get
lyang0@ovpovp-LH-Pass:/buildarea2/lyang0/ovp-test/ldd-logs/tmp$ grep -v -f openvswitch-1.10.0-r4.dep openvswitch-1.10.0-r4-full.dep
libc.so.6(GLIBC_2.14)(64bit)
libssl.so.1.0.0(OPENSSL_1.0.0)(64bit)
Sorry..I really didn't understand your requirement clearly, I thought you just want to find difference between two file with one line item per line. it displays what is not in file1 but in file2 in your case it is fullfile, and I request please explain briefly along with input and desired output while posting thread about your requirement and make sure that others will understand it at first glance.