17
votes
1answer
488 views

Is there a standard command that always exits with a failure?

I want to test my script with a command that fails. I could use an existing command with bad arguments. I could also write a simple script that immediately exits with a failure. Both of these are easy ...
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?