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

// for i in `find . -type f -a -name \*.txt`; do cp -p $i ${i%}.bk; done
// find -type f -name \*.txt -exec touch -c -t `ls -l --full-time | awk '{print $6$7}' | sed 's/[-:]//g'` {} \;
差分 一覧