On this page
ECHO
Prints a single-quoted message, with ${name} variable values.
Syntax
ECHO '<message>'
Arguments
| Argument | Required | Values | Default |
|---|---|---|---|
'<message>' | Yes | One single-quoted string; '' is an apostrophe, ${name} a variable value | None |
Examples
ECHO 'Loading customers';
ECHO 'Customer ${customer_id} has ${order_count} orders';
ECHO 'It''s done';
ECHO 'Write $${name} to use a variable';
Example session
LET country_code = 'FRA';
ECHO 'Starting country check';
ECHO 'Country ${country_code}; step 2 -- loading';
ECHO 'It''s done';
ECHO 'Write $${country_code} to use the variable';
Starting country check
Country FRA; step 2 -- loading
It's done
Write ${country_code} to use the variable
Details
The message
The message is exactly one single-quoted string, at the prompt or in a Script. Inside it:
''prints one apostrophe;${name}prints the value of a scripting variable (NULLfor a NULL value), replaced beforeECHOruns, as in every statement;$${name}prints the text${name}unchanged;- spaces, line breaks,
;and--are printed as written.
An undefined variable makes the statement fail, and nothing is printed. A value that contains an apostrophe ends the quoted message, as in SQL: the statement then fails; write such a value with ''. Control characters are shown as ?.
Why the quotes
The quotes are required: without them, an apostrophe or -- in the text would change where the Script statement ends.
Output
ECHO output is never hidden by OUTPUT QUIET and is written to the activity log. It is the recommended way to print messages from a Script; PRINT is unchanged.
Related
Used in these how-tos
- How do I run a post-deployment smoke check on every environment?
- How do I write a report Script that stops at the first failure?
Last modified in release 5.5.5.
Found something wrong or unclear on this page? Tell us, with the page address.