2019-08-14 14:41:34 +01:00
|
|
|
|
# bash
|
|
|
|
|
|
|
|
|
|
> Bourne-Again SHell.
|
2021-08-02 09:41:09 +01:00
|
|
|
|
> 兼容`sh`的命令行解释器。
|
2023-12-29 12:11:32 +00:00
|
|
|
|
> 更多信息:<https://www.gnu.org/software/bash/>.
|
2019-08-14 14:41:34 +01:00
|
|
|
|
|
2022-03-27 06:25:15 +01:00
|
|
|
|
- 启动交互式 shell:
|
2019-08-14 14:41:34 +01:00
|
|
|
|
|
|
|
|
|
`bash`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 执行命令:
|
2019-08-14 14:41:34 +01:00
|
|
|
|
|
|
|
|
|
`bash -c "{{command}}"`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 执行脚本文件:
|
2019-08-14 14:41:34 +01:00
|
|
|
|
|
|
|
|
|
`bash {{file.sh}}`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 执行脚本文件,并将所有执行过的命令输出到终端:
|
2019-08-14 14:41:34 +01:00
|
|
|
|
|
|
|
|
|
`bash -x {{file.sh}}`
|
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
|
- 执行脚本文件,并在第一个错误处终止:
|
2019-08-14 14:41:34 +01:00
|
|
|
|
|
|
|
|
|
`bash -e {{file.sh}}`
|