- 论坛徽章:
- 36
|
本帖最后由 LikeLx 于 2013-10-31 16:17 编辑
试试这个行不- awk -F "=" 'NR==FNR{a[$1]=$2;next}{if($1 in a) ;else {a[$1]="";print $1,"is not exist in c.txt"} if(a[$1]&&$1 in a&&a[$1]!=$2) print $1 " in c.txt is",a[$1]}' c.txt b.txt
- /mstr/mstr/auxfiles/zip in c.txt is U
- /mstr/mstr/test is not exist in c.txt
- [root@dbserver ~]# cat b.txt c.txt
- /mstr/mstr=A
- /mstr/mstr/auxfiles=A
- /mstr/mstr/auxfiles/zip=A
- /mstr/mstr/auxfiles/zip/MicroStrategy.zip=A
- /mstr/mstr/test=A
- /mstr/mstr=A
- /mstr/mstr/auxfiles=A
- /mstr/mstr/auxfiles/zip=U
- /mstr/mstr/auxfiles/zip/MicroStrategy.zip=A
复制代码 |
|