echo newline suppression [duplicate]
问题 This question already has answers here : 'echo' without newline in a shell script (8 answers) Closed 2 years ago . Why doesn't $echo '-n' write -n on terminal although -n is written within single quotes ? 回答1: Because the quotes are processed by the shell and the echo command receives plain -n . If you want to echo -n , you can e.g. printf '%s\n' -n 回答2: you should try to use the more portable printf as far as possible. 回答3: You could try echo -e '\055n' 回答4: I found that the following just