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.
私はたくさんの*.datファイルを持っています。それぞれの重複する隣接行を削除できるbashスクリプトとは何ですか?
*.dat
こんな感じですか?
#!/bin/bash for f in "$@" do cp "$f" /tmp/tmp.dat uniq /tmp/tmp.dat > "$f" done
多くの *.dat ファイルがあるディレクトリで実行できる場所。これを というスクリプトに入れuniq_datて実行可能にすると、次のように実行できます。
uniq_dat
uniq_dat *.dat