commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Schaible <>
Subject RE: Single quotes in --StartParams
Date Tue, 30 Jan 2007 06:58:22 GMT
Hi Hanson,

Hanson Ho wrote on Tuesday, January 30, 2007 1:17 AM:

> Hi,
> I'm launching my Java program through procrun, and I'm
> looking for a way to
> pass an argument through --StartParams which contains a
> single quote, e.g.
> steve's file. However, I can't seem to find a way to properly
> escape the
> single quote, i.e. neither --StartParams="steve's file",
> --StartParams="steve''s file", nor --StartParams="steve\'s
> file" results in
> the literal string "steve's file" being passed down properly.
> Any ideas?

There's no general answer, since the command line is passed by the shell before any Java code
can analyze it. Since you pass params to your app, you might enclose the complete expression
in quotes:

"--StartParam=Steve's File"  (Windows CMD)
"--StartParam=Steve\'s File" (Bash)

- Jörg

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message