多文件合并

#!/bin/bash

awk -F "	" '
function trim(str){ 
        sub(/^[ 	]*/,"",str); 
        sub(/[ 	]*$/,"", str);
        return str;
}
        NR==FNR{
                a[trim($1)] = $0
        }
        NR > FNR{
                if(a[trim($4)]){
                        print $0"	"a[$4]
                }else{
                        #print trim($4)
                }
        }
' result_2 ueg
原文地址:https://www.cnblogs.com/bai-jimmy/p/6027953.html