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