Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The arguments are handled by the shell (I assume you are using bash under linux?), so any terminal settings should not affect this. Since you already have quoted the argument it ought to work. The only possible explanation I can think of is if your <code>java</code> command is a wrapper script and messes up the escaping of the arguments when passing on to the real program. This is easy to do, or perhaps a bit hard to do correctly.</p> <p>A correct wrapper script should pass all its arguments on as <code>${1+"$@"}</code>, any other version is most likely a bug with regards to being able to handle embedded spaces properly. This is not uncommon to do properly, however also any occurrences of <code>$2</code> or similar are troublesome and must be written as <code>"$2"</code> (or possibly <code>${2+"$2"}</code>) in order to handle embedded spaces properly, and this is sinned against a lot.</p> <p>The reason for the not so intuitive syntax <code>${1+"$@"}</code> is that the original <code>$*</code> joined all arguments as <code>"$1 $2 $3 ..."</code> which did not work for embedded spaces. Then <code>"$@"</code> was introduced that (correctly) expanded to <code>"$1" "$2" "$3" ...</code> for all parameters and if no parameters are given it should expand to nothing. Unfortunately some unix vendor messed up and made <code>"$@"</code> expand to <code>""</code> even in case of no arguments, and to work around this the clever (but not so readable) hack of writing <code>${1+"$@"}</code> was invented, making <code>"$@"</code> only expand if parameter <code>$1</code> is set (i.e. avoiding expansion in case of no arguments).</p> <p>If my wrapper assumption is wrong you could try to debug with strace</p> <pre><code>strace -o outfile -f -ff -F java test.AskGetCampaignByName "Dummy books" </code></pre> <p>and find out what arguments are passed to execve. Example from running "<code>strace /bin/echo '1 2' 3</code>"</p> <pre><code>execve("/bin/echo", ["/bin/echo", "1 2", "3"], [/* 93 vars */]) = 0 brk(0) = 0x2400000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f420075b000 mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f420075a000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/usr/lib64/alliance/lib/tls/x86_64/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/usr/lib64/alliance/lib/tls/x86_64", 0x7fff08757cd0) = -1 ENOENT (No such file or directory) open("/usr/lib64/alliance/lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) ... </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload