echo

From RaySoft

Write arguments to the standard output.[1]

Documentation

Syntax

echo [PARAMETER ...] [TEXT]

Parameters

-e
If the -e option is given, interpretation of the following backslash-escaped characters is enabled.
  • \b for backspace
  • \n for new line
  • \r for carriage return
  • \t for horizontal tab
  • \\ for backslash
-n
If -n is specified, the trailing newline is suppressed.

Examples

*beep*
echo -en '\007'
Fewer use of echo followed by a pipe

Send a variable directly to stdin using <<<.

extension='jpg'
echo "${extension}" | sed 's/./[&\u&]/g'
sed 's/./[&\u&]/g' <<<"${extension}"

Output:

[jJ][pP][gG]
[jJ][pP][gG]

References

  1. bash -c 'help echo'