This question already has an answer here:

I wanted to learn how the echo command works. I started with the following code.

echo -n "What is your name -- "
read i 
echo "Your name is $i"

I do not understand why I still have a new trailing character.

"-n What is your name --"

I am on a mac OS X 10.12.6. I am using zsh. Had the same results with Bash.

marked as duplicate by Jeff Schaller, thrig, Community Dec 12 '17 at 23:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    This thread answers your question. – PesaThe Dec 12 '17 at 23:03
  • @PesaThe Thank you! While the answer was in the man page I didn't see it when I red the echo man page. – politicus Dec 16 '17 at 0:53

Browse other questions tagged or ask your own question.