Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

As a part of a shell script, I want to replace

LIBTOOL='$(SHELL) $(top_builddir)/libtool'

with

LIBTOOL=./libtool

The source line number is 528. I try to using sed as follow

sed -e '528 s/LIBTOOL=\'\$(SHELL) \$(top_builddir)\/libtool'/LIBTOOL=.\/libtool/'**

but I received an error.

So any help would be appreciated.

share|improve this question
1  
Would you mind to include the error message with your question? –  Izzy Jul 25 '12 at 7:55
add comment

1 Answer

You've got another unescaped single quote inside your expression (look at \/libtool'/LIBTOOL). So here is what works for me:

sed "528 s/LIBTOOL='\$(SHELL) \$(top_builddir)\/libtool'/LIBTOOL='.\/libtool'/" filename.ext

Note that I did not include the -e parameter, as that expects a filename to read its expressions from (and you provide the expression at the command line -- don't confuse this file with the file to be processed).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.