echo
Write arguments to the standard output.[1]
- GNU Coreutils [EN] @ Fedora Package
- GNU Coreutils [EN] @ Homebrew Formula
Documentation
- echo [EN] @ GNU Bash Reference Manual
- echo [EN] @ GNU Coreutils Manual
- bash -c 'help echo'
- man 1 'bash' [EN]
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'
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
- ↑ bash -c 'help echo'