1

I would like to replace <Path_To_BOOST_LIB_DIR> in a file with the content of ${PREFIX}/lib but this command

sed -i .bak 's|<Path_To_BOOST_LIB_DIR>|echo ${PREFIX}/lib|' src/CMakeLists.txt

produced

set(BOOST_LIB_DIR echo ${PREFIX}/lib)

What did I do wrong?

  • No shell variables inside single quotes… You can turn them into double quotes but keep in mind that it's still interpreted as it's written in there so you better don't have certain characters in the path name which also have a meaning in a regular expression. – phk Jan 15 '17 at 21:22

0 Answers0