On Sat, Jun 21, 2014 at 12:48 AM, Paul Boniol <[email protected]> wrote:
> I need to do a fairly complex search and replace across an entire site's
> files.
>
> Find files ending in certain extensions (over 1,700 files)
> Exclude files in certain directories
> Search contents of matching files for a certain pattern.  If found, rewrite
> the file replacing the pattern..
> Preserve the file modification date on modified files.

Heh- if I didn't know you, I'd say it sounds sketchy:
1) Back-date records.
2) Get caught in massive money-laundering scheme.
3) Profit!!!    ;-)

Something wrong with my meme... Anyway:

> While I was able to do most of this on the command line in Linux (find,
> grep, sed), preserving the modification date on the files didn't appear to
> be an option.

You can stat the file to get the mdate, and then use touch at the end
to re-set it.

> (Also it removed write permission on the files... Easily  fixed, but just 
> odd.)

Definitely weird. You checked your current umask?

-- 
-- 
You received this message because you are subscribed to the Google Groups 
"NLUG" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nlug-talk?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"NLUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to