Skip to content

ECHO

Syntax

Terminal window
ECHO message

Parameters

ParameterDescriptionTypeRequired
messageA string of characters, numbers, or a mix of both to printString / NumberYes

Return values

ConditionReturn Value
Command is successfulThe message passed as a parameter
Syntax or specified constraints are invaliderror

Errors

  1. Syntax Error:
    • Error Message: (error) ERR wrong number of arguments for 'echo' command
    • Occurs if the command is called with additional or fewer parameters than required

Example Usage

Valid usage

Terminal window
127.0.0.1:7379> ECHO "DiceDB is very efficient"
"DiceDB is very efficient"

Invalid Usage

Terminal window
127.0.0.1:7379> ECHO
`(error) ERROR wrong number of arguments for 'echo' command`
Terminal window
127.0.0.1:7379> ECHO "DiceDB is" "very efficient"
(error) ERROR wrong number of arguments for 'echo' command`

Conclusion

In DiceDB, the ECHO command accepts only one message string and prints it. If no message or more than one message is provided, it results in an error