Display text or expand variables to the screen or to a log file. When used in scripts with spooling (log-file generation) turned on, echo expands variables in the log file. For interactive sessions, variables are not expanded in the log file; instead, the variable name you typed is recorded (for example, $1).
echo <text> | <variablename>
See examples of echo under the discussion of variables (Quotation Marks and Variable Expansion).