awk '{
for(i = 1; i <= NF; i++) {
j = i + 1;
if($i == $j) {
print FNR " | " $0 " | " $i;
}
}
}' myfile
如果myfile
有这些行:
There is a storm storm outside .
My my car is red .
输出将是:
1 | There is a storm storm outside . | storm
如何使命令忽略区分大小写并显示?
2 | My my car is red . | my