Tagged Questions
15
votes
1answer
347 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 ...
7
votes
2answers
1k 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?