sorry if this is a duplicate, i had no idea what to search for...
my use case is more complex, but can be narrowed down to the following problem:
i want to run a bash script, which invokes all sorts of binaries, for example: grep. i want to assert that the binaries were invoked with the correct arguments. these assertions should be part of automated testing, i don't want to manually start checking things. this should go into ci cycle.
is there some standard way of doing this?
if not, i thought of moving all the binaries i wish to assert, replace them with a spy which first logs the arguments and then invokes the original binary and finally remove itself and return the original binary.
is this feasible? is there a better approach to the problem?