W3C home > Mailing lists > Public > xproc-dev@w3.org > June 2012

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

From: Yves Forkl <Y.Forkl@srz.de>
Date: Tue, 05 Jun 2012 10:47:32 +0200
Message-ID: <4FCDC7A4.7030100@srz.de>
To: XProc Dev <xproc-dev@w3.org>

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?

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:03:10 UTC