printf "-Xdebug"
Gives:
bash: printf: -X: invalid option
printf: usage: printf [-v var] format [arguments]
echo -n "-Xdebug"
works but according to this question here it isn't portable.
There are multiple versions of the echo command, with different behaviors. Apparently the shell used for your script uses a version that doesn't recognize -n.
How can I have a string be printed to screen uninterpreted, as is?