Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .