#StackBounty: #linux #bash #debian #shell #dash Trap on DEBUG signal for the dash shell?

Bounty: 50

With the bash shell, you can install a trap on the synthetic DEBUG signal. This is useful and will execute your function or bit of code on every shell command. For example:

$ trap 'logger -t shell "${BASH_COMMAND}"' DEBUG

Looking at the dash shell source code, I seem to understand there’s no such DEBUG signal available.

Are these any workarounds or alternatives to achieve the same result with the dash shell?


Get this bounty!!!