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.
2 つのファイルの内容を比較しようとしていますが、どちらも 1 列の数値です。
ファイル1:
1.2 2.6 3.4 4.7 5.3
ファイル 2:
5.1 4.8 3.2 2.5 1.6
出力は、file2 の対応する行よりも大きい file1 の行数になります。したがって、この場合は次のようになります
3
paste続いて使用してみてくださいawk
paste
awk
paste file1 file2 | awk '$1>$2 {i++} END {print i}'
出力: