Greetings.
In article <485756b8$0$6616$(E-Mail Removed)>, Matthew
Lincoln wrote:
> I am not sure about on how to specify that a second command should only
> be execute in case that the first command fails/succeeds.
>
> When I enter:
>
> cmd1 | gzip -f ... && cmd2
>
> Is then cmd2 executed only if cmd1 is finished successfully or if gzip is
> finished successfully?
>
> Is the command concatenation "&&" correct at all?
>
> What if I want cmd2 only to execute if both (cmd1 and gzip) end
> successfully?
>
> What about the other way: cmd2 should only be executed if
>
> a) cmd1 failed
>
> b) cmd1 or gzip failed?
This is pretty trivial to test empirically on your own:
$ true | false && echo foo
$ false | true && echo foo
foo
$ true | true && echo foo
foo
$ false | false && echo foo
$
--
_
_V.-o Tristan Miller [en,(fr,de,ia)] >< Space is limited
/ |`-' -=-=-=-=-=-=-=-=-=-=-=-=-=-=-= <> In a haiku, so it's hard
(7_\\
http://www.nothingisreal.com/ >< To finish what you