From owner-freebsd-questions@FreeBSD.ORG Tue Feb 15 08:57:02 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 8EA11106564A for ; Tue, 15 Feb 2011 08:57:02 +0000 (UTC) (envelope-from erikmccaskey64@zoho.com) Received: from sender1.zohomail.com (sender1.zohomail.com [72.5.230.95]) by mx1.freebsd.org (Postfix) with ESMTP id 735158FC0A for ; Tue, 15 Feb 2011 08:57:02 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=date:from:to:message-id:in-reply-to:references:subject:mime-version:content-type:user-agent; b=JKg6MqcdFNUEXmURa+NByLnS6cp+6oMdbbstTbqAxs82859VPH6SbFPcJekz22V75pGgO7NjYrt8 aWVLtLMeKxsZnkkSHGWb8dk9GSjH05Tgt6S/yM1jkBEjFLAg9Ert Received: from 172.29.249.242 (172.29.249.242 [172.29.249.242]) by mx.zohomail.com with SMTP id 129776021843329.625365828846725; Tue, 15 Feb 2011 00:56:58 -0800 (PST) Date: Tue, 15 Feb 2011 00:56:58 -0800 From: erikmccaskey64 To: "freebsd" Message-ID: <12e28896cd5.6574638108640039636.4001582758217268039@zoho.com> In-Reply-To: References: <3.0.1.32.20110214163437.019167e0@sage-american.com> MIME-Version: 1.0 X-Priority: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Status: RO Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 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: Tue, 15 Feb 2011 08:57:02 -0000 my little opinion: first run the changes on a backup, or a copy of the file= s: this one works under linux bash fedora: how to create a "shadow" of a folder [same filenames in another dir, but wi= th 0 Byte size] in the original, "A" directory: find . -type f > a.txt "B" directory: cat ../a.txt | while read file; do if [[ "$file" =3D */* ]]; then mkdir -p = "${file%/*}"; fi; touch "$file"; done so if something goes wrong, there would be no trouble ---- Be Mon, 14 Feb 2011 15:11:19 -0800 Adam Vande More <amvandemore@gma= il.com> =C3=ADrta ----=20 On Mon, Feb 14, 2011 at 4:34 PM, Jack L. Stone <jacks@sage-american.com&= gt;wrote:=20 =20 > Hello folks:=20 >=20 > No doubt this will be easy for those with scritping abilities.=20 >=20 > I have a gazillion files by the same name and each contains the same l= ine=20 > requiring the same change. But the problem is that they are in many=20 > different directories on a server with numerous domains. While I could= =20 > handle the change using a single directory within my abilities, I'm un= sure=20 > how to do a search and replace throughout the many domains and their= =20 > directories. Don't want to mess up. Here's what I'm trying to do:=20 >=20 > # find all of the same filenames (copyright.htm) and then replace the = year=20 > 2010 with 2011 in each file. Once I have a working script, I should be= able=20 > to add it as a cron job to run on the first day of each new year.=20 >=20 > Any help appreciated.=20 >=20 =20 /usr/ports/misc/rpl=20 =20 --=20 Adam Vande More=20 _______________________________________________=20 freebsd-questions@freebsd.org mailing list=20 http://lists.freebsd.org/mailman/listinfo/freebsd-questions=20 To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org= "=20 =20