 in computing, echo is a command in dos, os/2, microsoft windows, singularity, unix and unix-like operating systems that places a string on the computer terminal. it is a built-in command typically used in shell scripts and batch files to output status text to the screen or a file. many shells, including bashhttps://www.gnu.org/software/bash/manual/html_node/bash-builtins.html and zsh,http://zsh.sourceforge.net/doc/release/shell-builtin-commands.html implement echo as a builtin command. ==usage example== > echo hello world hello world using ansi escape code sgr sequences, compatible terminals can print out colored text: fgred=`echo "\033[31m"` fgcyan=`echo "\033[36m"` bgred=`echo "\033[41m"` fgblue=`echo "\033[35m"` bggreen=`echo "\033[42m"` normal=`echo "\033[m"` and after : echo "${fgblue} text in blue ${normal}" echo "text normal" echo "${bgred} background in red" echo "${bggreen} background in green and back to normal ${normal}" some variants of unix, such as linux, support the options -n and -e, and do not process escape sequences unless the -e option is supplied. for example, fgred=`echo -e "\033[31m"` might be used under linux. unfortunately, such options are non standardieee std 1003.1, 2004, documentation for echo due to historical incompatibilities between bsd and system v; the printf command can be used in situations where this is a problem. it is therefore recommended that printf be used to ensure that escape sequences are processed. the equivalent code using printf is simply fgred=`printf "\033[31m"`. ==implementation example== the echo command can be implemented in the c programming language with only a few lines of code: #include #include /* echo command-line arguments; 1st version */ int main(int argc, char *argv[]) { int i; for (i = 1; i < argc-1; i++) { (void) printf("%s%s", argv[i], " "); } (void) printf("%s%s", argv[argc-1], "\n"); return exit_success; } scripting languages can also emulate echo quite simply: $ perl -e 'print join " ", @argv; print "\n"' this is a test. this is a test. $ python -c "import sys; print ' '.join(sys.argv[1:])" this is a test. this is a test. ==see also== *list of unix programs *list of dos commands ==references==  ==external links== * *microsoft technet echo article  
Computing_commands Internal_DOS_commands OS/2 Standard_Unix_programs Unix_SUS2008_utilities Windows_administration Windows_commands