Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

I want to compile Boost with some specific options (eg: using zlib from its latest source)

So I try next bash code like:


echo_run ./
#// problem with \"$WD/$ZLIB_ROOT_DIR\"
echo_run ./b2 -j4 -d0 debug release --toolset=gcc --with-thread --with-system --with-filesystem --with-program_options --with-regex --with-date_time --with-iostreams -sZLIB_SOURCE=\"$WD/$ZLIB_ROOT_DIR\"   link=static runtime-link=static --prefix=./$BOOST_INSTALL_SUBDIR install
echo Done!

But I get next outputfrom b2:

./b2 -j4 -d0 debug release --toolset=gcc --with-thread --with-system --with-filesystem --with-program_options --with-regex --with-date_time --with-iostreams -sZLIB_SOURCE="/home/tim/Рабочий стол/mask-viewer-standalone/MaskLoader/zlib_libraries" link=static runtime-link=static --prefix=./install-dir install
notice: could not find main target стол/mask-viewer-standalone/MaskLoader/zlib_libraries"
notice: assuming it is a name of file to create.

Which is preatty scarry!( (стол is part of russian Ubuntu translation of Desctop - Рабочий стол)

So I wonder - what I do wrong - how to make b2 friend of paths with spaces?

share|improve this question
up vote 1 down vote accepted

You can quote the shell variables like: -sZLIB_SOURCE="$WD"/"$ZLIB_ROOT_DIR". Do not escape the quotes.

share|improve this answer

Your Answer


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.