echo began within
Multics. After it was programmed in
C by
Doug McIlroy as a "finger exercise" and proved to be useful, it became part of
Version 2 Unix. echo -n in
Version 7 replaced prompt, (which behaved like echo but without terminating its output with a line delimiter). On
PWB/UNIX and later
Unix System III, echo started expanding
C escape sequences such as \n with the notable difference that octal escape sequences were expressed as \0ooo instead of \ooo in C.
Eighth Edition Unix echo only did the escape expansion when passed a -e option, and that behaviour was copied by a few other implementations such as the builtin echo command of
Bash or
zsh and GNU echo. On
MS-DOS, the command is available in versions 2 and later. ==Examples==