Q: How do I replace a system command including its arguments on a Linux system?
Scenario: there is a command on a system which takes arguments.
$ command -a restart Output: something
I'd like to replace the execution of that specific command with that specific parameter with e.g.
command -a reload && echo hi. In that way, the command would never execute a restart, but a reload.
- Other parameters should not interfere.
command -a elseshould be executed as
command -a else.
- Command is executed for the root user only
- I cannot replace the command file itself, as an update of the package would replace it
Is this possible?