You are trying to print -n, which is interpreted as an argument, to disable printing of the trailing newline.
printfSuitable here :
$ printf "%s" "-n"
-n
If you want a new line after n,
$ printf "%s\n" "-n"
-n
An ugly way using echowould be to use the octal value for a hyphen, that is -,
$ echo -e '\055n'
-n
The argument -eallows you to interpret escape backslashes.
source
share