Hello,
In version 5.9 the [[ ]]
operator is behaving unexpectedly for the following case:
$ watch ls &
$ [ $(jobs -l | wc -l) -gt 0 ] && echo jobs found || echo no jobs
jobs found
$ [[ $(jobs -l | wc -l) -gt 0 ]] && echo jobs found || echo no jobs
no jobs
The result should be the same, in this case, with both [ ]
and [[ ]]
.
[[ $(jobs -l | wc -l) -gt 0 ]]
exit status is > 0
when there are jobs running.
zsh 5.9 (x86_64-pc-linux-gnu)
Previous version, 5.8.1
was working as expected.
Tested in the following distros