When you really want to write unless command ; then stmts fi you can do it by writing command if test $? != 0 ; then # command failed stmts fi If stmts is sufficiently simple, you can also do command || { stmts }