tldr/pages/common/dash.md

33 lines
701 B
Markdown
Raw Normal View History

# dash
> Debian Almquist Shell, a modern, POSIX-compliant implementation of `sh` (not Bash-compatible).
> More information: <https://manned.org/dash>.
- Start an interactive shell session:
`dash`
2022-10-22 21:08:14 +01:00
- Execute specific [c]ommands:
2022-10-22 21:08:14 +01:00
`dash -c "{{echo 'dash is executed'}}"`
2022-10-22 21:08:14 +01:00
- Execute a specific script:
`dash {{path/to/script.sh}}`
2022-10-22 21:08:14 +01:00
- Check a specific script for syntax errors:
`dash -n {{path/to/script.sh}}`
- Execute a specific script while printing each command before executing it:
`dash -x {{path/to/script.sh}}`
2022-10-22 21:08:14 +01:00
- Execute a specific script and stop at the first [e]rror:
`dash -e {{path/to/script.sh}}`
2022-10-22 21:08:14 +01:00
- Execute specific commands from stdin:
2022-10-22 21:08:14 +01:00
`{{echo "echo 'dash is executed'"}} | dash`