dynamicsoar's log

主に研究関係のメモ

shell script

git completion (for bash) & prompt を入れる

git/contrib/completion at master · git/git · GitHub ここにある。やるべきことはスクリプト内に全部書いてあるが、一応自分用にメモ。 git-completion.bash と git-prompt.sh をそれぞれ .git-completion.bash と .git-prompt.sh の名前で ~/ に保存する…

現在走ってるjobの終了を待って次のジョブを投入したい→tailを使う

普通に考えると wait かな、って思うんだけど、けっこう前に走らせたジョブがあって、という場合、 [pid] is not a child of this shell とか怒られてうまくいかない。いろいろググったところ、なんと tail を使えというお言葉が…: bash - WAIT for "any pr…

連番などのファイルを pbzip2 で圧縮して別のディレクトリに出力

前提 Cygwin の pbzip2(デフォルトだと入ってない) bash (なので、たぶん Linux でも同様にできるはず) サンプルコード $ for file in *.dat; do pbzip2 -m1000 -ck "${file}" > "/cygdrive/f/path_to_dir/${file}.bz2"; done & オプションは、-c はたぶ…