サクっとかけるとうれしいよね。

for と find を良い感じで利用できるようになってきた事により、すごい作業効率が上がってきた感じです。 徐々に覚えてきてることが実感できてちょっとうれしい感じ。

ちなみにこんな作業してました。

// ディレクトリの内容表示
# ls -l
合計 112
drwxrwxr-x 10 www apache 4096 1022 23:29 create_qtl
drwxrwxr-x 10 www apache 4096 1022 23:29 direct_movie
drwxrwxr-x 10 www apache 4096 1022 23:30 export_ts
drwxrwxr-x 10 www apache 4096 1022 23:30 fifpon
drwxrwxr-x 10 www apache 4096 1022 23:30 hatena_design
drwxrwxr-x 10 www apache 4096 1022 23:30 hp
drwxrwxr-x 10 www apache 4096 1022 23:30 ir9lib
drwxrwxr-x 10 www apache 4096 1022 23:30 pacont
drwxrwxr-x 10 www apache 4096 1022 23:30 pitashot
drwxrwxr-x 10 www apache 4096 1022 23:30 showmsime
drwxrwxr-x 10 www apache 4096 1022 23:30 soturon
drwxrwxr-x 10 www apache 4096 1022 23:30 tamagoyaki
drwxrwxr-x 10 www apache 4096 1022 23:30 test
drwxrwxr-x 10 www apache 4096 1022 23:30 winsdk

// trac.ini 内のリポジトリ内文字コードを shift_jis の設定に変更する
# for f in `find -name trac.ini`
> do
> cp $f $f.org
> perl -pe "s/iso-8859-15/japanese.shift_jis/g" $f.org > $f
> done

// trac を svnリポジトリと同期させる
# for f in `ls -1`
> do
> trac-admin $f resync
> done
Resyncing repository history...
17 revisions cached. Done.
Resyncing repository history...
21 revisions cached. Done.
Resyncing repository history...
31 revisions cached. Done.
Resyncing repository history...
783 revisions cached. Done.
Resyncing repository history...
13 revisions cached. Done.
Resyncing repository history...
99 revisions cached. Done.
Resyncing repository history...
176 revisions cached. Done.
Resyncing repository history...
113 revisions cached. Done.
Resyncing repository history...
2 revisions cached. Done.
Resyncing repository history...
17 revisions cached. Done.
Resyncing repository history...
70 revisions cached. Done.
Resyncing repository history...
23 revisions cached. Done.
Resyncing repository history...
3 revisions cached. Done.
Resyncing repository history...
6 revisions cached. Done.

うむ。 こんなのプロジェクトごとにコマンド実行なんてやってられませんな。 :)


でまぁ問題は for を書く時に割と高確率で次の感じで誤爆しちゃうことでしょうか。

#for $f in `*.txt` do hoge $f

dos と混ざるぜHAHAHA