Brian Cryer's Web Resources

CryEcho: Command line flags

CryEcho with no arguments will generate the following summary help information showing each of the command line flags it can take:

CryEcho - from www.cryer.co.uk 1.0 (build November 2011)
A console application which displays a message to standard out.
Unlike "echo" it does not automatically add a newline.

 CryEcho [+n|-n] [-q] message

 -n  echoes the message without a newline. This is the default.
 +n  echoes the message with a newline at the end.
 -q  ignores any double quotes.

The following character substitutions are performed before echoing:

 \a - Alert; buzzer beep on most PCs
 \b - Backspace
 \n - Newline
 \r - Carriage return
 \s - Space
 \t - Tab
 \" - Double quote
 \\ - Single back-slash

What these flags mean:

Do not echo a carriage return at the end. This is the default behaviour of CryEcho, so it is unlikely that you would want to use this flag.
Echo a carriage return at the end. The default behaviour of CryEcho is not to include a newline after it has displayed the message, adding this flag forces CryEcho to add a newline at the end. This makes its behaviour almost the same as the in-build echo command.


C:\>CryEcho +n message

produces the same output as:

C:\>CryEcho message\n

or the more traditional:

C:\>echo message

Ignore (or remove) any double quotes. So any double quotes (except double quotes which are escaped) will not be echoed.

What the substitutions mean:

Echo the alert character. This normally sounds the buzzer briefly.
Backspace. This allows the previous character to be deleted.


C:\>CryEcho 1\b2

will produce:


Actually it produces "1" followed by a backspaced followed by "2", which ends up as showing a "2". But if you were to pipe the output from CryEcho to a file then that file would capture all three characters.



C:\>CryEcho 1\n2

will produce:


Carriage return. A carriage return moves the print position (or the position where the next character will be printed) to the start of the current line.


C:\>CryEcho 123\r45 

will produce:


As the "45" has overprinted the start of "123".

Tab. A tab will advance to the next tab stop. Think of a tab stop as being 8 characters wide, then a tab will advance to the beginning of the next tab block. This can be useful when aligning output visually.


C:\>CryEcho one\ttwo\three\tfour

will produce:

one     two
three   four

A double quote. An escaped double quote will appear even if quotes are suppressed using the -q flag.
A single slash. This allows you to echo a backslash ('\') without fear that it might be interpreted as part of another substitution.


C:\>CryEcho one\\two

will produce:


Had this been a single slash then it would instead have been interpreted as "one<tab>wo".

More Information

For more information please refer to one of the following pages: