perl -pi -e 'BEGIN { %s = map { $_ => [stat $_] } @ARGV} s/foo/bar/g; +END { for $f (keys %s) { utime(@{ $s{$f} }[8,9], $f) } }' [files]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: in-place edit preserving file modification times
by Juerd (Abbot) on Apr 21, 2003 at 15:32 UTC | |
by Your Mother (Archbishop) on Apr 25, 2003 at 08:44 UTC |