Reputation: 31963
I know that this is some kind of special character issue but I do not know how to solve it.
I type in console
echo "-n"
and nothing get printed :(
I also tried with
echo -e "-n"
to execute the special characters (the one escaped from sequence) but again nothing happend
how can I print "-n" ?
Upvotes: 9
Views: 287
Reputation: 500287
Here is one way:
aix@aix:~$ echo -e '\x2dn'
-n
It escapes the -
as \x2d
.
A more verbose way is to print the two characters separately:
aix@aix:~$ echo -n -; echo n
-n
Here, the -n
instructs the first echo
to not print a newline; it is not related to the -n
being printed. :)
Upvotes: 5