Re: [Help-bash] The difference between 'if cond; then' and 'cond && {'
From:
Eduardo Bustamante
Subject:
Re: [Help-bash] The difference between 'if cond; then' and 'cond && {'
Date:
Sun, 2 Dec 2018 19:52:26 -0800
On Sun, Dec 2, 2018 at 7:40 PM Peng Yu <address@hidden> wrote:
>
> It sounds like the following construct would always produce the same
> result. Is it so?
>
> if some_cond; then
> do something1
> do something2
> fi
>
> somc_cond && {
> do something1
> do something2
> }
There is a difference if you want to
- use "else"
- use a more complicated condition