Expr

From DssWiki

Jump to: navigation, search

{{DISPLAYTITLE:{{#if:|:|}}expr}}

echo means several things in computing.

Contents

[edit] Terminal/program command

echo is a command in Unix (and by extension, its descendants, such as Linux) and MS-DOS that places a string on the terminal. It is typically used in shell scripts and batch programs to output status text to the screen or a file.

$ echo This is a test.
This is a test.
$ echo "This is a test." > ./test.txt
$ cat ./test.txt
This is a test.

Some variants of Unix support options such as -n and -e. These are not standard<ref>IEEE Std 1003.1, 2004, documentation for echo</ref> due to historical incompatibilities between BSD and System V; the printf command can be used in situations where this is a problem.


The source code in C of an echo program is:

#include <stdio.h>
/* echo command-line arguments; 1st version */
main(int argc, char *argv[])
{
int i;
for (i = 1; i < argc; i++)
printf("%s%s", argv[i], (i < argc-1) ? " " : "");
printf("\n");
return 0;
}

[edit] Ping

echo refers to a ping request. See RFC 792.

[edit] Server

An echo server is a standard service implementing the ECHO protocol that runs on TCP port 7. Intended for testing purposes, it replies to all packets with a packet containing the same data. It is rarely used in practice.

[edit] Other Languages

echo is also a command in programming languages such as PHP <ref>PHP Manual: echo</ref> to output one or more strings.

[edit] References

{{ #ifeq: 100% | 100% | <references/> |
<references/>
}}


<noinclude>Template:Unix-stub
Personal tools
efta 468 03-27-08 JOIN OUR TEAM!!