Echo (computer science)

from Wikipedia, the free encyclopedia

Echo is a simple general concept in computer science that is based on the acoustic echo . It is used in many tools, especially in the command line under almost all operating systems , in programming languages as output commands and in networks. The basic functionality is the same everywhere as with the identical illustration in mathematics, an input (mostly in the form of a character string) is received and output again unchanged. In addition, there is an important delay between input and output or receipt, especially in the network area, as is also present in the acoustic model. This delay is mainly caused by data transmission in areas of application where it plays a role .

Command line and scripting languages

The echo command is part of the standard scope of commands for most of the command lines that are provided in extensive programs and especially in operating systems. This command is used there for the output of strings and variables on an output device such as the screen or a file . They can be used either directly in the command line or within a shell script - also called batch files under DOS and Windows . If the user redirects the output to a file, they can use it to create a text file or append the output to an existing text file. Some command line interpreters that support the echo command are bash , csh , COMMAND.COM , cmd.exe , Windows PowerShell but also the console of the computer game Half-Life .

Some scripting languages that offer an echo command are not intended for direct use with a command line, but are mainly suitable for use in script files, for example PHP .

Under DOS and Windows, the echo command can also be used to control the output of the executed commands on the screen if they were called within a batch file. Each line of the file appears again on the screen or on another output device as long as this has not been switched off with echo off ; echo on switches the output back on.

Computer communication

This concept is also often used in computer networks . In the Internet protocol family , there is the echo protocol , which is intended for use with an echo network service. The task of a server providing this network service is to return the data received from a client unchanged. The specification is made in RFC 862 and RFC 347 .

see also: Echo (network service)

In addition, the defined ICMP standard including two types of messages echo request ( echo request ) and echo reply ( echo reply ). These messages are also known as ping or pong packets and are mainly intended for diagnostic purposes to check the availability of a computer in the network. A message with useful data, which is usually filled with letters of the alphabet, is sent to a target computer. The target computer receives this message and sends the same user data back unchanged to the recipient. When the recipient receives the reply message, it evaluates the time required for the transmission (there and back together). This happens, for example, with the ping command line program, which is part of the standard scope of delivery in many operating systems . The ICMP standard is specified in RFC 792 .

for detailed information see also: Ping (data transfer)

Furthermore, the term echo is used in the Telnet protocol for the option that defines whether the characters returned via the Telnet connection should be output or not. At this point, the option has a similar meaning to the on and off parameters in the cmd.exe command echo . Specification in RFC 857 .

Another illustrative example of using this concept is the echo mailer . In doing so, the content of every received email is sent back to the sender together with the header data.