2014-05-11 13:20:51 +03:00
# echo
2016-01-07 18:31:27 +01:00
> Print given arguments.
2024-12-18 02:01:36 -08:00
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/echo-invocation.html>.
2014-05-11 13:20:51 +03:00
2016-01-07 18:31:27 +01:00
- Print a text message. Note: quotes are optional:
2014-05-11 13:20:51 +03:00
2020-10-04 19:33:38 +02:00
`echo "{{Hello World}}"`
2014-05-11 13:20:51 +03:00
2016-01-07 18:31:27 +01:00
- Print a message with environment variables:
2014-05-11 13:20:51 +03:00
2020-10-04 19:33:38 +02:00
`echo "{{My path is $PATH}}"`
2016-07-21 19:22:49 +05:30
- Print a message without the trailing newline:
2020-10-04 19:33:38 +02:00
`echo -n "{{Hello World}}"`
2016-07-21 19:22:49 +05:30
2019-06-22 17:40:44 +02:00
- Append a message to the file:
2020-10-04 19:33:38 +02:00
`echo "{{Hello World}}" >> {{file.txt}}`
2019-06-22 17:40:44 +02:00
2016-07-21 19:22:49 +05:30
- Enable interpretation of backslash escapes (special characters):
2020-10-04 19:33:38 +02:00
`echo -e "{{Column 1\tColumn 2}}"`
2023-07-25 13:17:16 -04:00
- Print the exit status of the last executed command (Note: In Windows Command Prompt and PowerShell the equivalent commands are `echo %errorlevel%` and `$lastexitcode` respectively):
`echo $?`