2018-12-01 12:09:33 UTC
I’d like to check how frequent each external command is called by a bunch
of bash scripts (one may call another). On way to do so is to hook a call
back function at the finish of the execution of each external command. But
I don’t see such a feature in bash.
Another way is to wrap around each possible external command with a command
of the same name which is in a directory prepended to $PATH. Those wrappers
will record the times they are called, then call the original command with
the same name. But this is cumbersome.
Is a good way to record how many times each external command is called?