For instance I have many aliases for Terminal created so that with one command I can execute many commands, so I may have a command to update rkhunter
which also does freshclam
, which is basically this:
sudo rkhunter --update && sudo rkhunter --versioncheck && sudo freshclam
And I may even want to automate this task so that it runs every hour or so, however with this there is a problem, for if anyone of those commands fails, then the command after it (if there is one), will not be executed. And as this may also be an automated task, I won't even know that somewhere down the line something is failing which is meaning that everything beyond that point is not even going to be run.
And as this is a major problem for me at the moment especially if I want to automate tasks through aliases and the such without creating a script etc, is there any way of making it so that if one of the commands fail for the next command after the &&
to still be run?
Also, another thing is that this does not happen all of the time, in fact sometimes it fails and still runs the next command, but at most times it does not, so there is really even any way of predicting whether it is going to fail or not, and I'm not even too sure why it is failing.
So is there a way to fix this, and why is it failing anyway?