Skip to contentSkip to conversation

What does echo -c do (as found in dynamic-debug-howto.txt)

PATCH New Alexander Holler 2 participants 3 messages Dec 26, 2013 – Jan 1, 2014 Documentation

lore
Share & tools
lore
#0 lore raw

Hello,

I've just read Documentation/dynamic-debug-howto.txt (again) and I wonder what the parameter -c for echo is for (found at lines 94 ff).

Neither echo from coreutils nor the buildin from bash do know the parameter -c.

The paragraph which made me curious starts with

-----
Command Language Reference
==========================

At the lexical level, a command comprises a sequence of words separated by spaces or tabs. So these are all equivalent:

nullarbor:~ # echo -c 'file svcsock.c line 1603 +p' >
<debugfs>/dynamic_debug/control
nullarbor:~ # echo -c ' file svcsock.c line 1603 +p ' >
<debugfs>/dynamic_debug/control
nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
<debugfs>/dynamic_debug/control
-----

Is that -c a parameter for a buildin echo of one of the various shells, a typo (looks unlikely) or do I miss something else which make me look a noob?

Regards,

Alexander Holler

#1 lore raw
Quoted 7 lines · Alexander Holler

Hello,

I've just read Documentation/dynamic-debug-howto.txt (again) and I wonder what the parameter -c for echo is for (found at lines 94 ff).

Neither echo from coreutils nor the buildin from bash do know the parameter -c.

Huh. No idea.

Annotate points at Jason Baron, whom you've cc'd...

Rob

Quoted 3 lines

Is that -c a parameter for a buildin echo of one of the various shells, a typo (looks unlikely) or do I miss something else which make me look a noob?

I've implemented echo for toybox, it has -n and -e support. "man echo" shows -neE (and -E is one of those pointless gnuisms that doesn't actualy do anything). man bash shows the echo builtin also has -neE.

No -c anywhere to be found, it's not just you...

Rob

#2 lore raw

PATCH 1/1 Documentation: correct typo in dynamic-debug-howto.txt (echo -c -> echo -n)

As nobody could answer what the parameter -c for echo should be, I assume it's a typo. Normally I don't care much about those, but this one might make people search for the meaning of the parameter -c.

---
 Documentation/dynamic-debug-howto.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/dynamic-debug-howto.txt +2 -2
index 1bbdcfc..abb7dfe 100644
@@ -91,9 +91,9 @@ Command Language Reference
 At the lexical level, a command comprises a sequence of words separated
 by spaces or tabs.  So these are all equivalent:
 
-nullarbor:~ # echo -c 'file svcsock.c line 1603 +p' >
+nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
 				<debugfs>/dynamic_debug/control
-nullarbor:~ # echo -c '  file   svcsock.c     line  1603 +p  ' >
+nullarbor:~ # echo -n '  file   svcsock.c     line  1603 +p  ' >
 				<debugfs>/dynamic_debug/control
 nullarbor:~ # echo -n 'file svcsock.c line 1603 +p' >
 				<debugfs>/dynamic_debug/control
Signature · 1 line
1.8.1.4