Sed Help.....

Volker Eckert volkere at cs.tu-berlin.de
Wed Nov 10 14:34:37 PST 2004


On Wed, Nov 10, 2004 at 02:43:01PM +0000, Rod Person wrote:
> 
>     KDMLINE="/usr/local/bin/kdm -nodaemon"
>     REPLACELINE="/usr/X11R6/bin/xdm -nodaemon"
> 
>     sed -e "s/$REPLACELINE/$KDMLINE/g" /etc/test/ttys > /etc/test/new
> 
> Here is the error I'm getting:
>     sed: 1: "s//usr/X11R6/bin/xdm -n ...": bad flag in substitute command: 'X'
               ^^^^^^^^^^^^^^^^^^^^^^^

my guess is:

after expanding $REPLACELINE your command looks like you see above,
which is not what you wanted.
proposed solution: use other delimiters for sed.


More information about the freebsd-questions mailing list