From owner-freebsd-questions@FreeBSD.ORG Wed Jan 11 20:46:31 2006 Return-Path: X-Original-To: questions@freebsd.org 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 02C3616A41F for ; Wed, 11 Jan 2006 20:46:31 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41FE643D4C for ; Wed, 11 Jan 2006 20:46:28 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id 523B35DF4; Wed, 11 Jan 2006 15:46:27 -0500 (EST) Received: from pi.codefab.com ([127.0.0.1]) by localhost (pi.codefab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22267-03; Wed, 11 Jan 2006 15:46:25 -0500 (EST) Received: from [199.103.21.238] (pan.codefab.com [199.103.21.238]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by pi.codefab.com (Postfix) with ESMTP id 912F45CFC; Wed, 11 Jan 2006 15:46:25 -0500 (EST) In-Reply-To: References: Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <23FC76D5-450C-4C07-8D46-782C86E6D6B3@mac.com> Content-Transfer-Encoding: 7bit From: Charles Swiger Date: Wed, 11 Jan 2006 15:46:23 -0500 To: Kristian Vaaf X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: amavisd-new at codefab.com Cc: questions@freebsd.org Subject: Re: My script to replace strings in ASCII files 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: Wed, 11 Jan 2006 20:46:31 -0000 On Jan 11, 2006, at 3:24 PM, Kristian Vaaf wrote: > Just curious, what do I need to do to be able to execute this > script like: > > $ text-replace old_string new_string > > I find it a bit inconvenient having to edit the script for every > thing I need to replace. Use positional arguments $1 and $2, rather than "old" and "new" in the sed statement. -- -Chuck