From owner-freebsd-questions@FreeBSD.ORG Tue Nov 16 09:16:30 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 3B67B16A4CE for ; Tue, 16 Nov 2004 09:16:30 +0000 (GMT) Received: from hosea.tallye.com (joel.tallye.com [216.99.199.78]) by mx1.FreeBSD.org (Postfix) with ESMTP id 71CF343D45 for ; Tue, 16 Nov 2004 09:16:29 +0000 (GMT) (envelope-from lorenl@alzatex.com) Received: from hosea.tallye.com (hosea.tallye.com [127.0.0.1]) by hosea.tallye.com (8.12.8/8.12.10) with ESMTP id iAG9GLYs027295 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 16 Nov 2004 01:16:21 -0800 Received: (from sttng359@localhost) by hosea.tallye.com (8.12.8/8.12.10/Submit) id iAG9GJpY027286; Tue, 16 Nov 2004 01:16:19 -0800 X-Authentication-Warning: hosea.tallye.com: sttng359 set sender to lorenl@alzatex.com using -f Date: Tue, 16 Nov 2004 01:16:19 -0800 From: "Loren M. Lang" To: Giorgos Keramidas Message-ID: <20041116091618.GB10375@alzatex.com> References: <200411101443.01977.personrp@hotpop.com> <200411101515.49950.personrp@hotpop.com> <20041111061255.GC1569@gothmog.gr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041111061255.GC1569@gothmog.gr> User-Agent: Mutt/1.4.1i X-GPG-Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc X-GPG-Fingerprint: B3B9 D669 69C9 09EC 1BCD 835A FAF3 7A46 E4A3 280C cc: freebsd-questions@freebsd.org cc: Rod Person Subject: Re: Sed Help..... 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: Tue, 16 Nov 2004 09:16:30 -0000 On Thu, Nov 11, 2004 at 08:12:55AM +0200, Giorgos Keramidas wrote: > On 2004-11-10 15:15, Rod Person wrote: > > On Wednesday 10 November 2004 7:58 pm, mailing lists at MacTutor wrote: > > > Take a look at what the shell replacement is actually doing. If you > > > were to write the line manually it would look like this: > > > > > > sed -e 's/\/usr\X11R6\/bin\/xdm/\/usr\/local\/bin\/kdm/g' ... > > > > > > Right? > > > > > > But the shell doesn't escape the path separators (slashes). You need to > > > escape them yourself in the variable assignments. Like this, > > > > > > KDMLINE='\/usr\/local\/bin\/kdm' > > > &c > > > > I hate when you look at something for hours and it something you know you > > should have known! I had at one point had the variables with double qoute and > > even tried to escape the qoutes!! I'd recommend using the : because it's the least likely character to appear in a filename since : is the seperator used in $PATH. But then again, who would use a | in a filename!? > > You can also use different sed-separator characters: > > sed -e "s|${REPLACELINE}|${KDMLINE}|" > > The choise of '|' is arbitrary above. It could have been '@', '#', or > '!', for all that sed(1) cares. The substitution would still work. > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" -- I sense much NT in you. NT leads to Bluescreen. Bluescreen leads to downtime. Downtime leads to suffering. NT is the path to the darkside. Powerful Unix is. Public Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc Fingerprint: B3B9 D669 69C9 09EC 1BCD 835A FAF3 7A46 E4A3 280C