Results 1 to 2 of 2
Hi,
I want to print "-n" in shell.
i tried follwoing:
echo -n "-n"
but it did not work.
Please help....
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-20-2011 #1Just Joined!
- Join Date
- Apr 2011
- Posts
- 6
Printing "-n"
Hi,
I want to print "-n" in shell.
i tried follwoing:
echo -n "-n"
but it did not work.
Please help.
- 07-12-2011 #2Just Joined!
- Join Date
- Nov 2006
- Posts
- 2
Solutions
I've had a similar issue. This worked for me:
orCode:echo - -n
depending on what you are trying to do. I don't know why just one dash there works, instead of the usual "dash dash" to end options.Code:echo -n - -n
For greater flexibility you may want to look at printf:
Code:printf "-n"


Reply With Quote
