awk / sed script to remove text
Posted
by radman
on Stack Overflow
See other posts from Stack Overflow
or by radman
Published on 2010-05-21T06:23:21Z
Indexed on
2010/05/21
6:30 UTC
Read the original article
Hit count: 259
Hi,
I am currently needed of way to programmatically remove some text from Makefiles that I am dealing with. Now the problem is that (for whatever reason) the makefiles are being generated with link commands of -l<full_path_to_library>/<library_name>
when they should be generated with -l<library_name>
. So what I need is a script to find all occurrences of -l/
and then remove up to and including the next /
.
Example of what I'm dealing with
-l/home/user/path/to/boost/lib/boost_filesystem
I need it to be
-lboost_filesystem
As could be imagined this is a stop gap measure until I fix the real problem (on the generation side) but in the meantime it would be a great help to me if this could work and I am not too good with my awk and sed.
Thanks for any help.
© Stack Overflow or respective owner