echo
What is echo?
echo: Echo — Print text or variable values to the terminal. echo prints text to the terminal. echo "Deploy finished" prints a message, and echo $HOME prints the value of a variable. It is used constantly in shell scripts: status messages, writing a line to a file with echo "text" >> file, or quickly checking what a variable contains while debugging.
Frequently asked questions about echo
What should you keep in mind with echo?
A few details save trouble. Use double quotes around variables, as in echo "$path", so spaces and special characters are kept intact. Different systems handle options like -e and -n differently, so for anything beyond simple text, printf is more predictable. And be careful about echoing secrets in CI scripts. Logs are often visible to many people, and most CI systems only mask secrets they know about.
At a glance
| Category | CLI commands |
|---|---|
| Explained by | Reinier de la Parra |
| Updated |