From owner-freebsd-questions@FreeBSD.ORG Sat Jun 26 17:08:57 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 146B716A4CE for ; Sat, 26 Jun 2004 17:08:57 +0000 (GMT) Received: from mtaw6.prodigy.net (mtaw6.prodigy.net [64.164.98.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id DC66743D2F for ; Sat, 26 Jun 2004 17:08:56 +0000 (GMT) (envelope-from antennex@swbell.net) Received: from SAGEAME (adsl-65-68-247-73.dsl.crchtx.swbell.net [65.68.247.73]) by mtaw6.prodigy.net (8.12.10/8.12.10) with SMTP id i5QH6sdH000883 for ; Sat, 26 Jun 2004 10:06:54 -0700 (PDT) Message-ID: <00ce01c45ba0$343ffc00$0200000a@SAGEAME> From: "antenneX" To: Date: Sat, 26 Jun 2004 12:08:24 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 Subject: A SED script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: antenneX List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jun 2004 17:08:57 -0000 Running FBSD-4.10 Below is a portion of a script that uses sed(1) to change a portion of a line in a file. It works fone for that one. However, I cannot get it to work on another file (perl.pl file) to change the line: $OrderNumPrefix = "ATX060"; to $OrderNumPrefix = "ATX070"; I suspect I'm not handling the quotes or other operators correctly and it just ignores the change. Here's the snippet of the script I'm trying to use: #!/bin/sh new=`grep -i new /path/to/newfile` old=`grep -i new /path/to/oldfile` sed -i.bak -e "s/$old/$new/" /path/to/myfile ....and, again the line in the file: $OrderNumPrefix = "ATX060"; <---line in the file to change What do I need to change to make it work....??? Thanks for any help! Best regards, Jack L. Stone