Re: how much are "historic" issues with test / [ still an issue
From:
Greg Wooledge
Subject:
Re: how much are "historic" issues with test / [ still an issue
Date:
Tue, 25 May 2021 13:44:14 -0400
On Tue, May 25, 2021 at 06:16:20PM +0200, Christoph Anton Mitterer wrote:
> - anything else >= 4 might is ambiguous, and one should use the forms
> with multiple test(s) and combine those via ||, &&, and the shell's ( )
> (i.e. the unquoted parentheses that cause subshell evaluation).
Use { ; } instead of ( ) for this. There's no need to fork subshells.
if { test firstthing || test secondthing; } &&
{ test thirdthing || test fourththing; }; then
body
fi
Or, use [[ ]] if you're writing for bash.