Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
output1.dat と output2.dat の 2 つのファイルの 6 列目が同一かどうかを確認しようとしています。それ、どうやったら出来るの?
awk 'NR==FNR{a[NR]=$6;next}a[FNR]!=$6{print "diff @ lineNr:",FNR;exit}' file1 file2
テストしていませんが、あなたのニーズに合っていることを願っています。ファイルの列/フィールド区切りはスペースだと思います。
2 つのファイルの 6 列目が同じ場合、出力はありません。それ以外の場合は、最初の等しくない行番号を出力します。