2011-04-19から1日間の記事一覧

一時ファイルの一掃

"clean up temporary files"から拝借。 #! bash # # 終了時処理 # http://www.linuxjournal.com/content/use-bash-trap-statement-cleanup-temporary-files # declare -a on_exit_items function on_exit { for i in "${on_exit_items[@]}" do eval $i done …

while-read loop

障害 次のコードは find の処理でよく使われる典型的な手法です*1。 find . -type f -path "*.ts" | { while read f do echo "$f" done } うまく行きますし、保守しやすいコードなので、多用しています。ところが、次のコードはうまく行くように見えますが、…