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.
連続した重複行を削除しようとしているとき
awk "!x[$0]++" file
その報告x[: Event not found.
x[: Event not found.
同じ場合でも
sed -i -e "$!N; /^\(.*\)\n\1$/!P;D" file 同様に報告
sed -i -e "$!N; /^\(.*\)\n\1$/!P;D" file
N: Event not found. 私も一重引用符で試しましたが、役に立ちませんでした
N: Event not found.
それらを修正するためのアイデア
シェルの履歴置換を呼び出しています。感嘆符を一重引用符で囲みます。