2020-07-09 21:30:44 +01:00
|
|
|
# echo
|
|
|
|
|
|
|
|
> 输出给定参数.
|
2021-04-01 16:54:26 +01:00
|
|
|
> 更多信息: <https://www.gnu.org/software/coreutils/echo>.
|
2020-07-09 21:30:44 +01:00
|
|
|
|
|
|
|
- 输出文本信息. 注意: 引号是可选的:
|
|
|
|
|
2020-10-04 18:33:38 +01:00
|
|
|
`echo "{{Hello World}}"`
|
2020-07-09 21:30:44 +01:00
|
|
|
|
|
|
|
- 输出带有环境变量的信息:
|
|
|
|
|
2020-10-04 18:33:38 +01:00
|
|
|
`echo "{{My path is $PATH}}"`
|
2020-07-09 21:30:44 +01:00
|
|
|
|
|
|
|
- 打印不带尾随换行符的信息:
|
|
|
|
|
2020-10-04 18:33:38 +01:00
|
|
|
`echo -n "{{Hello World}}"`
|
2020-07-09 21:30:44 +01:00
|
|
|
|
|
|
|
- 向文件添加信息:
|
|
|
|
|
2020-10-04 18:33:38 +01:00
|
|
|
`echo "{{Hello World}}" >> {{file.txt}}`
|
2020-07-09 21:30:44 +01:00
|
|
|
|
|
|
|
- 启用反斜杠转义的解释(特殊字符):
|
|
|
|
|
2020-10-04 18:33:38 +01:00
|
|
|
`echo -e "{{Column 1\tColumn 2}}"`
|