From owner-freebsd-questions@FreeBSD.ORG Mon Feb 14 22:58:34 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5276106566B for ; Mon, 14 Feb 2011 22:58:34 +0000 (UTC) (envelope-from sterling@camdensoftware.com) Received: from wh2.interactivevillages.com (wh2.interactivevillages.com [75.125.250.34]) by mx1.freebsd.org (Postfix) with ESMTP id AA4B48FC08 for ; Mon, 14 Feb 2011 22:58:34 +0000 (UTC) Received: from c-24-22-230-24.hsd1.wa.comcast.net ([24.22.230.24] helo=_HOSTNAME_) by wh2.interactivevillages.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Pp7NE-0003Uj-KR for freebsd-questions@freebsd.org; Mon, 14 Feb 2011 14:58:29 -0800 Received: by _HOSTNAME_ (sSMTP sendmail emulation); Mon, 14 Feb 2011 14:58:29 -0800 Date: Mon, 14 Feb 2011 14:58:29 -0800 From: Chip Camden To: freebsd-questions@freebsd.org Message-ID: <20110214225829.GF2714@libertas.local.camdensoftware.com> Mail-Followup-To: freebsd-questions@freebsd.org References: <3.0.1.32.20110214163437.019167e0@sage-american.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ChQOR20MqfxkMJg9" Content-Disposition: inline In-Reply-To: <3.0.1.32.20110214163437.019167e0@sage-american.com> User-Agent: Mutt/1.4.2.3i Company: Camden Software Consulting URL: http://camdensoftware.com X-PGP-Key: http://pgp.mit.edu:11371/pks/lookup?search=0xD6DBAF91 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - wh2.interactivevillages.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - camdensoftware.com Subject: Re: script help X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Feb 2011 22:58:35 -0000 --ChQOR20MqfxkMJg9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoth Jack L. Stone on Monday, 14 February 2011: > Hello folks: >=20 > No doubt this will be easy for those with scritping abilities. >=20 > 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: >=20 > # 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 ab= le > to add it as a cron job to run on the first day of each new year. >=20 > Any help appreciated. >=20 > Thanks! > Jack >=20 > (^_^) > Happy trails, > Jack L. Stone >=20 > System Admin > Sage-american > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" find /upper-dir -name copyright.htm -exec sed -i '' -e "s/2010/2011/g" {} \; --=20 Sterling (Chip) Camden | sterling@camdensoftware.com | 2048D/3A978E4F http://chipsquips.com | http://camdensoftware.com | http://chipstips.com --ChQOR20MqfxkMJg9 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQEcBAEBAgAGBQJNWbOVAAoJEIpckszW26+R278H/0cXBFJ6eWmbiYzWmcJ4SIMt UGCY3z/NoyA69dgNA/RrgQ6H2oj+YuwtoNfIdoyP/QV/cuWbpZ1583X+C1W4JS6A sVAfbW+p+jX+6sSZaYLG7PKX0lsAc/b9h+6gPkMXQAcVT9eXKlyrZGI6Ho/uK2sC KO3unf8th/mnNoDYxPcbFQGVu7OVzSvB1HXMZrvX8CwsLDQSsJ+1y0/XSkLWmDyL xsq3z5X1jA3PPumeMsRnGVHFrpe7Jf1xwLs8LBOPU8ioHgfzJLpG2bk25p6uXCpJ uycIMCxPwlNIf0U4yoZpQwH536aJRVz9qrXYwIWZX3PoScsKaQhkSwBZDwn9LVc= =mOq7 -----END PGP SIGNATURE----- --ChQOR20MqfxkMJg9--