2016-01-04 19:55:14 +00:00
|
|
|
# bash
|
|
|
|
|
2021-04-04 21:07:13 +01:00
|
|
|
> Bourne-Again SHell, an `sh`-compatible command line interpreter.
|
|
|
|
> See also `histexpand` for history expansion.
|
2019-06-09 00:05:27 +01:00
|
|
|
> More information: <https://gnu.org/software/bash>.
|
2016-01-04 19:55:14 +00:00
|
|
|
|
2016-02-23 01:14:41 +00:00
|
|
|
- Start interactive shell:
|
2016-01-04 19:55:14 +00:00
|
|
|
|
|
|
|
`bash`
|
|
|
|
|
2016-02-23 01:14:41 +00:00
|
|
|
- Execute a command:
|
2016-01-04 19:55:14 +00:00
|
|
|
|
2016-09-04 20:59:10 +01:00
|
|
|
`bash -c "{{command}}"`
|
2016-01-04 19:55:14 +00:00
|
|
|
|
2016-02-23 01:14:41 +00:00
|
|
|
- Run commands from a file:
|
2016-01-04 19:55:14 +00:00
|
|
|
|
2016-02-23 01:14:41 +00:00
|
|
|
`bash {{file.sh}}`
|
2016-01-04 19:55:14 +00:00
|
|
|
|
2017-09-21 08:35:20 +01:00
|
|
|
- Run commands from a file, logging all commands executed to the terminal:
|
|
|
|
|
|
|
|
`bash -x {{file.sh}}`
|
|
|
|
|
2019-01-23 06:27:08 +00:00
|
|
|
- Run commands from a file, stopping at the first error:
|
|
|
|
|
|
|
|
`bash -e {{file.sh}}`
|
|
|
|
|
2021-01-31 17:05:18 +00:00
|
|
|
- Run commands from stdin:
|
2016-01-04 19:55:14 +00:00
|
|
|
|
2016-02-23 01:14:41 +00:00
|
|
|
`bash -s`
|
2016-09-01 14:31:38 +01:00
|
|
|
|
2020-10-19 17:50:30 +01:00
|
|
|
- Print the version information of bash (use `echo $BASH_VERSION` to show just the version without license information):
|
2016-09-01 14:31:38 +01:00
|
|
|
|
|
|
|
`bash --version`
|