Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

sed and bourne shell scripting

Name: Anonymous 2008-03-09 7:46

i'm looking for a way to make sed NOT parse too much into the replace pattern

basically i'm trying to put a variable into the replace pattern, not a problem except that this variable contains stuff like -Wl and so forth, i suspect this makes sed bug out and throw errors like this
sed: 1: "s/^PERL_LDOPTS=/PERL_LD ...": bad flag in substitute command: 'u'
when i run code like this
MAKEFILE=`echo "$MAKEFILE" | sed s/^PERL_LDOPTS=/PERL_LDOPTS="$PERL_LDOPTS"/`
on text like this
PERL_LDOPTS=
and the content of the $PERL_LDOPTS variable is
  -Wl,-R/usr/local/lib/perl5/5.8.8/mach/CORE  -Wl,-E -L/usr/local/lib /usr/local/lib/perl5/5.8.8/mach/auto/DynaLoader/DynaLoader.a -L/usr/local/lib/perl5/5.8.8/mach/CORE -lperl -lm -lcrypt -lutil

so do i have to escape all the dashes or can i solve this with a sed argument?

Name: Anonymous 2008-03-09 14:00

oh you can use other delimiters, i had no idea, that would save me a call to sed, thanks

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List