[PLUG] another bash question

Shannon C. Dealy dealy at deatech.com
Tue Aug 6 21:27:46 UTC 2002


On Tue, 6 Aug 2002, Don Buchholz wrote:

> Richard Kurth wrote:
> >
> > Ok I removed the backslash after $A so it looks like this
> > A=$(uname -n)
> >  sed -e "/ServerName localhost/c\
> >  ServerName $A
> >  " < httpd.conf
> >
> >  and I still get the
> >  sed: -e expression #1, char 24: Extra characters after command
[snip]
>
>   sed -e "/ServerName localhost/c\\
>   ServerName $A
>   " < httpd.conf
[snip]

While Don was sorting this out, it occurred to me to ask what it was you
were trying to do (I had just been looking at it from a Bash perspective)
Wouldn't it be both simpler and cleaner to do this instead:

   sed -e "s/ServerName localhost/ServerName $A/" < httpd.conf

or am I missing something?

Shannon C. Dealy      |               DeaTech Research Inc.
dealy at deatech.com     |          - Custom Software Development -
                      |    Embedded Systems, Real-time, Device Drivers
Phone: (800) 467-5820 | Networking, Scientific & Engineering Applications
   or: (541) 451-5177 |                  www.deatech.com





More information about the PLUG mailing list