echo
The shell command that prints its arguments as a line of text.
In more detail
On its own it writes to the terminal. With redirection it writes into a file, and >> appends a copy every time the command runs.
Examples
echo "listen 8080" >> by-hand/server.confansible all -m ansible.builtin.command -a "echo hello" reports changed every time, because the command module cannot tell what a command did.echo "hello, $name"echo "exit code $?"Related terms
- redirection — Sending a command's output into a file instead of the terminal: > replaces the file, >> appends to the end of it.
- command module — The module that runs any program you name on the host and reports what it printed, without being able to tell whether it changed anything.
- printf — The command that prints text according to a format string, such as printf '%s\n' "$name".
- escape sequence — A backslash followed by a character that together stand for something hard to type directly, such as \n for a line break.
Taught in
- What Configuration Management Is — Ansible Configuration Management at Scale
- Your First Ad Hoc Command — Ansible Configuration Management at Scale
- What A Shell Is, And What Bash Is — Bash Scripting & Command Line Automation
- Standard Input, Output And Error — Bash Scripting & Command Line Automation
- Script Input And Output: read, Heredocs, printf — Bash Scripting & Command Line Automation
- POSIX sh Versus Bash — Bash Scripting & Command Line Automation
- Conventional Commits — Advanced Git Internals & Distributed Workflows
- Resolving A Conflict, Line By Line — Advanced Git Internals & Distributed Workflows
- Graded On A Machine You Never Touched — RHCE in Ansible (EX294): Automate Red Hat Systems
- Facts And Magic Variables: Let Each Node Describe Itself — RHCE in Ansible (EX294): Automate Red Hat Systems
- Deploying Files: file, copy, lineinfile And blockinfile — RHCE in Ansible (EX294): Automate Red Hat Systems