help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] The difference between 'if cond; then' and 'cond && {'


From: Peng Yu
Subject: Re: [Help-bash] The difference between 'if cond; then' and 'cond && {'
Date: Sun, 2 Dec 2018 22:01:44 -0600

> > 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"

I assume there is no "else".

> - use a more complicated condition

Could you give an example when they can not be made to return the same
result no matter what? Thanks.

-- 
Regards,
Peng



reply via email to

[Prev in Thread] Current Thread [Next in Thread]