Ravi Sir's Cards › AWS
Debug in 4 steps
This revision card explains Debug in 4 steps. It starts from the need that syntax only. It describes lint. The how-to section notes trace with line numbers. An example on the card is read the logs.
Read card text
What this card says
Why do we need it?
Syntax only.
bash -n x.sh
What is it?
Lint.
shellcheck x.sh
How to do it
Trace with line numbers.
PS4='+ ${LINENO}: ' bash -x x.sh
Example
Read the logs.
journalctl -t x -n 50