Skip to content
Young Yu edited this page May 25, 2024 · 6 revisions

The echo command simply sends some value to the server. Then the server sends the exact same value back.

CLI

Usage

echo <value>
  • value: This is a required field specifying the value that the server should echo back.

Example

> echo "hello world!"
hello world!
> echo 2024
2024

TCP

Assume all values are encoded using the length-prefixed protocol, without spaces in between (the spaces in the TCP format are just for clarification). For example by SET NAME JOE I mean 3\r\nSET4\r\nNAME3\r\nJOE where each value is prefixed by it's length followed by the delimiter \r\n.

Format

ECHO <value>
  • value: This is a required field specifying the value that the server should echo back.

Example

4\r\nECHO5\r\nhello
Clone this wiki locally