Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

echoing in shell -n doesn't get printed the right thing

Tags:

linux

bash

shell

sh

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" ?

like image 869
Lukap Avatar asked Jan 19 '12 08:01

Lukap


1 Answers

Try

printf "%s\n" -n

or

printf "%s\n" '-n'
like image 70
Fritz G. Mehner Avatar answered Sep 25 '22 16:09

Fritz G. Mehner