From owner-freebsd-questions@FreeBSD.ORG Fri Sep 3 23:37:08 2004 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 8240316A4CE for ; Fri, 3 Sep 2004 23:37:08 +0000 (GMT) Received: from smtp.3dresearch.com (h-66-167-251-2.phlapafg.covad.net [66.167.251.2]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4E4BB43D48 for ; Fri, 3 Sep 2004 23:37:08 +0000 (GMT) (envelope-from web@3dresearch.com) Received: by smtp.3dresearch.com (Postfix, from userid 33) id B45BD328AD; Fri, 3 Sep 2004 19:37:08 -0400 (EDT) To: freebsd-questions@freebsd.org Received: from 209.195.149.104 (auth. user janos@imap.3dresearch.com) by vmail.3dresearch.com with HTTP; Fri, 03 Sep 2004 23:37:08 +0000 X-IlohaMail-Blah: janos@imap.3dresearch.com X-IlohaMail-Method: mail() [mem] X-IlohaMail-Dummy: moo X-Mailer: IlohaMail/0.8.12 (On: vmail.3dresearch.com) From: jd Bounce-To: jd Errors-To: jd MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Message-Id: <20040903233708.B45BD328AD@smtp.3dresearch.com> Date: Fri, 3 Sep 2004 19:37:08 -0400 (EDT) Subject: String replacement with sed 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: Fri, 03 Sep 2004 23:37:08 -0000 I need to change a bunch of Analog config files; among other things change the location of IMAGEDIR. I made this simple script: #!/bin/sh for loop in `ls analog/*` do sed -e '/IMAGEDIR/s/www2.3dresearch.com\/analog_images\//fiordiligi.3dresearch.com\/= images\//p' $loop > $loop.sed done It works fine, except I get duplicate lines, such as: IMAGEDIR http://fiordiligi.3dresearch.com/images/ IMAGEDIR http://fiordiligi.3dresearch.com/images/ I want just a single line - what do I need to change? Thank you for your insight... jd Janos Dohanics