8
votes
2answers
3k views

Bash: run command2 if command1 fails

I want to do something like this: if cmd1 && cmd2 echo success else echo epic fail fi How should I do it?