I mean, how to dynamically stop a running shell script based on what operation it's doing. Because some dangerous commands such as
rm, if using regex before running, some edge situations may escape, like
#!/bin/bash name="" $name rm a.py
will still remove
So is there a way to detect what the next command is of a running script and stop it if matches.
Maybe complex regex can do this before running, but I want to know if there is a nice solution with running scripts.
I am not allowed to modify the scripts because it was given by others.