Top/Devel/ShellScript/複数ファイルの文字列置換(日付保持)

複数ファイルの文字列置換(日付保持)はてなブックマーク

恥ずかしげもなく一貫性なし :p

find -type f -name \*.txt -exec cp -p {} {}.bk \;
perl -p -i -e 's/^fo+/bar/g' *.txt
find -type f -name \*.txt -exec perl -e '@ts=stat($ARGV[0].".bk"); utime $ts[8],$ts[9],$ARGV[0]' {} \;
rm -f *.bk
差分 一覧