[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Organising conditions
From: |
Leonid Isaev (ifax) |
Subject: |
Re: Organising conditions |
Date: |
Mon, 2 Aug 2021 15:01:30 +0000 |
User-agent: |
Mutt/1.13.4 (2020-02-15) |
On Mon, Aug 02, 2021 at 02:46:46PM +0000, hancooper wrote:
> Then doing
> if [[ -d "$dir" && ! $list_raw ]]; then
> or
> if [[ -d "$dir" ]] && [[ ! $list_raw ]]; then
> is simply dependent on preference, rather than functionality?
If you are asking a generic question, then you should consider having more than
two tests. In this case, the former if..then stanza is better because it allows
grouping without subshells. For instance:
-----8<-----
if [[ (-d "$dir" && -z "$new_dir") || (! "$list_raw") ]]; then
...
fi
----->8-----
--
Leonid Isaev
- Organising conditions, hancooper, 2021/08/02
- Re: Organising conditions, Greg Wooledge, 2021/08/02
- Re: Organising conditions, hancooper, 2021/08/02
- Re: Organising conditions, hancooper, 2021/08/02
- Re: Organising conditions,
Leonid Isaev (ifax) <=
- Re: Organising conditions, hancooper, 2021/08/02
- Re: Organising conditions, Greg Wooledge, 2021/08/02
- Re: Organising conditions, hancooper, 2021/08/02
- Re: Organising conditions, Greg Wooledge, 2021/08/02
- Re: Organising conditions, hancooper, 2021/08/02
- Re: Organising conditions, Greg Wooledge, 2021/08/02
- Re: Organising conditions, Leonid Isaev (ifax), 2021/08/02
- Re: Organising conditions, hancooper, 2021/08/02
- Re: Organising conditions, Greg Wooledge, 2021/08/02
- Re: Organising conditions, hancooper, 2021/08/02