Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the Bash Escape Character "\c"?

What is the name and function of the \c escape character in Bash? What is its numeric value? I have seen that \cx is a control character, but what about plain \c? It seems that:

echo -e "Hello World\c"

and

echo -en "Hello World"

are equivalent. However, Python doesn't use it as an escape character, and it is missing from all of the lists of escape characters I found. Is this a Bash-specific behavior?

like image 835
Keith Pinson Avatar asked Aug 22 '11 23:08

Keith Pinson


1 Answers

That's actually specific to some versions of echo (I'm pretty sure that \c came from SysV while the -n version was a BSD-ism).

It simply means don't output the trailing newline.

like image 176
paxdiablo Avatar answered Sep 20 '22 05:09

paxdiablo