From owner-freebsd-questions@FreeBSD.ORG Thu Jul 10 10:30:15 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 06C6837B401 for ; Thu, 10 Jul 2003 10:30:15 -0700 (PDT) Received: from franklin-belle.com (adsl-65-68-247-73.dsl.crchtx.swbell.net [65.68.247.73]) by mx1.FreeBSD.org (Postfix) with ESMTP id 28CDC43F3F for ; Thu, 10 Jul 2003 10:30:14 -0700 (PDT) (envelope-from jackstone@sage-one.net) Received: from sagea (sagea.sage-american [10.0.0.3]) by franklin-belle.com (8.12.8p1/8.12.8) with SMTP id h6AHUCrv030502 for ; Thu, 10 Jul 2003 12:30:12 -0500 (CDT) (envelope-from jackstone@sage-one.net) Message-Id: <3.0.5.32.20030710123009.0135fe88@sage-one.net> X-Sender: jackstone@sage-one.net X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Thu, 10 Jul 2003 12:30:09 -0500 To: freebsd-questions@freebsd.org From: "Jack L. Stone" Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, hits=-0.7 required=4.5 tests=AWL version=2.54-fbelle.rules_v1 X-Spam-Checker-Version: SpamAssassin 2.54-fbelle.rules_v1 (1.174.2.17-2003-05-11-exp) Subject: Replacing string in multiple files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jul 2003 17:30:15 -0000 Am running FBSD.4.8-R At times, I need to replace an existing string in a file that has the same name in all ~user accounts and know there must be a short script to do that and suspect it involves sed(1). However, had no luck getting it to work yet. Basically want to do this: - find same files in all ~users by same name "~users/myfile" - replace this ${string} with this ${string} in the above files - report list of above files modified successfully That's it. Script help appreciated (csh shells).... Thanks in advance for any suggestions! Best regards, Jack L. Stone, Administrator SageOne Net http://www.sage-one.net jackstone@sage-one.net