You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
instead? (( is used for arithmetic evaluation, which is what -lt is trying to force inside [[.
(2) Also, seeing this:
[[ $#= 0 ]] && ...
rubs me the wrong way on multiple levels.
First, we are all taught that = is assignment and == is equivalence comparison. Yes, in bash they are the same when used inside [[, but = is used for assignment elsewhere in bash and IMHO this is just a bad coding practice.
Second, operator = within [[ is used for pattern matching and not arithmetic comparison. So, it should minimally be:
[[ $#-eq 0 ]] && ...
or better yet:
(($#==0))&& ...
to be more readable and consistent with (1).
The text was updated successfully, but these errors were encountered:
Hi @dimitry-ishenko thanks for your feedbacks. I will update them when I get some time. In the meantime you could raise a PR with the recommended changes and I am happy to review them.
(1) I see bash-utility heavily using
Wouldn't it be more readable to do
instead?
((
is used for arithmetic evaluation, which is what-lt
is trying to force inside[[
.(2) Also, seeing this:
rubs me the wrong way on multiple levels.
First, we are all taught that
=
is assignment and==
is equivalence comparison. Yes, in bash they are the same when used inside[[
, but=
is used for assignment elsewhere in bash and IMHO this is just a bad coding practice.Second, operator
=
within[[
is used for pattern matching and not arithmetic comparison. So, it should minimally be:or better yet:
to be more readable and consistent with (1).
The text was updated successfully, but these errors were encountered: