Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
printf "-Xdebug"

Gives:

bash: printf: -X: invalid option
printf: usage: printf [-v var] format [arguments]

echo -n "-Xdebug" works but according to this question herehere 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?

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?

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?

deleted 4 characters in body
Source Link
cuonglm
  • 155.1k
  • 39
  • 335
  • 412
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? How can I have a string be printed to screen uninterpreted, as is?

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?

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?

Post Undeleted by Kshitiz Sharma
Post Deleted by Kshitiz Sharma
Post Undeleted by Kshitiz Sharma
Post Deleted by Kshitiz Sharma
Source Link
Kshitiz Sharma
  • 8.9k
  • 22
  • 60
  • 76

How to print without formatting in bash?

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?