RICH-ATONE

shell 进行两个文本对比

shell参考如下:

#!/bin/bash

for h in `cat $1`;do
                [ `cat $2 | grep $h | wc -l`  -eq 0 ]&&{
                        echo $h | tee  -a ${2}.list
                }||{
                        continue
                }
        done
echo '------------------------------------------------------------'
for h in `cat $2`;do
                [ `cat $1 | grep $h | wc -l`  -eq 0 ]&&{
                        echo $h | tee -a  ${1}.list
                }||{
                        continue
                }
done

  

posted on 2022-11-26 11:56  RICH-ATONE  阅读(175)  评论(0编辑  收藏  举报

导航