shell while 双循环对比查找共有字段

Posted 攻城红卫兵

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了shell while 双循环对比查找共有字段相关的知识,希望对你有一定的参考价值。

#!/bin/bash

#查找两个文件中的共有字段
while read line
do
    while read line2
    do
        if [[ $line -eq $line2 ]]
        then
            echo $line2
        fi
    done < aaa.txt

done < bbb.txt

以上是关于shell while 双循环对比查找共有字段的主要内容,如果未能解决你的问题,请参考以下文章