Date: Tue, 16 Nov 2004 01:16:19 -0800 From: "Loren M. Lang" <lorenl@alzatex.com> To: Giorgos Keramidas <keramida@ceid.upatras.gr> Cc: Rod Person <personrp@hotpop.com> Subject: Re: Sed Help..... Message-ID: <20041116091618.GB10375@alzatex.com> In-Reply-To: <20041111061255.GC1569@gothmog.gr> References: <200411101443.01977.personrp@hotpop.com> <D8431F26-3352-11D9-91B4-000D9347C178@mactutor.biz> <200411101515.49950.personrp@hotpop.com> <20041111061255.GC1569@gothmog.gr>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Nov 11, 2004 at 08:12:55AM +0200, Giorgos Keramidas wrote: > On 2004-11-10 15:15, Rod Person <personrp@hotpop.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20041116091618.GB10375>