On 2020/03/13 07:52, Robert Elz wrote:
That's OK, and at times I have been tempted that way, but it really is
easier to just do
if <some relational test>
then
true_command1
true_command2
else
false_command1
false_command2
false_command3
fi
----
If you need an else clause, then using 'if' makes sense,
but for a simple 1-liner equivalent to C's
if (bool) truecase;
bash's
$bool && truecase
is certainly shorter than any if;then;fi case and for a simple 1-liner,
just as clear if not more so.
Being concise was certainly not a design priority as much for shell
as for C.