commands
bash — execute Bash scripts
Bash interprets scripts and commands. -n checks syntax; -x traces expanded commands to stderr and can disclose secrets. Use bash explicitly for Bash syntax. Example assumes a fresh shell lab fixture with new output names.
Formal Syntax & Structure
linux syntaxlinux
bash [-n|-x] [SCRIPT [ARG...]]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -n | option | syntax check |
| -x | option | trace |
| SCRIPT | operand | script path |
| ARG | operand | script arguments |
Return Value
exit status and output
Bash interprets scripts and commands. -n checks syntax; -x traces expanded commands to stderr and can disclose secrets. Use bash explicitly for Bash syntax.
Working Example
Example Snippetlinux
bash check-report.sh notes.txt