Calabash: How to quote whitespace in a parameter for the Bash shell?

Hi,

though the following problem is not strictly related to XProc, but rather to the usage of Calabash on Linux, maybe somebody on the list already solved it or might know how to go about it.

In a Bash shell script, I need to pass a parameter value containing spaces to Calabash, like this:

run_xproc \
  -isource=mysourcedoc.xml \
  mypipeline.xpl \
  doctype_public="-//OASIS//DTD DocBook XML V4.5//EN"


Where run_xproc is another Bash shell script that has:

java -cp "/usr/local/lib/saxon9.4/saxon9he.jar:/usr/local/lib/calabash/current/calabash.jar" \
  -Dcom.xmlcalabash.phonehome=false com.xmlcalabash.drivers.Main $@


I've tried various ways to get the value of parameter doctype_public safely through to Calabash, but didn't succeed: Either the value was chopped at the spaces or I ended up with single or double quotes in the result.
 
How to protect the spaces in the right way in both scripts?

Yves

Received on Tuesday, 5 June 2012 08:50:26 UTC