1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 10:02:10 +02:00

bash: refresh page (#7980)

* Refresh a page:
- better grammar
- better token syntax

* Simplify `-s` example
This commit is contained in:
Emily Grace Seville 2022-08-19 10:53:37 +10:00 committed by GitHub
parent 014427d75d
commit e7eae6c772
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,33 +1,33 @@
# bash
> Bourne-Again SHell, an `sh`-compatible command-line interpreter.
> See also `histexpand` for history expansion.
> See also: `zsh`, `histexpand` (history expansion).
> More information: <https://gnu.org/software/bash/>.
- Start an interactive shell session:
`bash`
- Execute a command and then exit:
- Start an interactive shell session without loading startup configs:
`bash -c "{{command}}"`
`bash --norc`
- Execute a script:
- Execute specific [c]ommands:
`bash -c "{{echo 'bash is executed'}}"`
- Execute a specific script:
`bash {{path/to/script.sh}}`
- Execute a script, printing each command before executing it:
- Execute a specific script while printing each command before executing it:
`bash -x {{path/to/script.sh}}`
- Execute commands from a script, stopping at the first error:
- Execute a specific script and stop at the first [e]rror:
`bash -e {{path/to/script.sh}}`
- Read and execute commands from stdin:
- Execute specific commands from stdin:
`bash -s`
- Print the Bash version (`$BASH_VERSION` contains the version without license information):
`bash --version`
`{{echo "echo 'bash is executed'"}} | bash`