script help
Chip Camden
sterling at camdensoftware.com
Mon Feb 14 22:58:35 UTC 2011
Quoth Jack L. Stone on Monday, 14 February 2011:
> Hello folks:
>
> No doubt this will be easy for those with scritping abilities.
>
> I have a gazillion files by the same name and each contains the same line
> requiring the same change. But the problem is that they are in many
> different directories on a server with numerous domains. While I could
> handle the change using a single directory within my abilities, I'm unsure
> how to do a search and replace throughout the many domains and their
> directories. Don't want to mess up. Here's what I'm trying to do:
>
> # find all of the same filenames (copyright.htm) and then replace the year
> 2010 with 2011 in each file. Once I have a working script, I should be able
> to add it as a cron job to run on the first day of each new year.
>
> Any help appreciated.
>
> Thanks!
> Jack
>
> (^_^)
> Happy trails,
> Jack L. Stone
>
> System Admin
> Sage-american
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
find /upper-dir -name copyright.htm -exec sed -i '' -e "s/2010/2011/g" {} \;
--
Sterling (Chip) Camden | sterling at camdensoftware.com | 2048D/3A978E4F
http://chipsquips.com | http://camdensoftware.com | http://chipstips.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20110214/5cbb10f2/attachment.pgp
More information about the freebsd-questions
mailing list