Hello!
I want to write a wrapper bash script, and to pass all arguments to a called program. I was very sure, that this works correctly:
#!/bin/sh
someProgam $@
But when passing exotic arguments (empty, unescaped, in quotes, ...) this fails.
For example: without the wrapper script, someProgram "1 2" 3
results in the arguments
[1 2]
and [3]
.
But called from the script, I get [1]
, [2]
, [3]
.
Braces are just for visualization.
NOTE: It's a Java program, which is called. But I think it doesn't matter.