I would appreciate it if anyone could offer a solution to the syntax:
Code: Select all
if [ 0 -lt ${size} 2>> ${Trash} ] ; then
greywolf.
Code: Select all
if [ 0 -lt ${size} 2>> ${Trash} ] ; then
I'm finding that error message only in the context of the "shellcheck" tool, available online at https://www.shellcheck.net/. If indeed you are referring to that you should've specified such: it's not standard and apparently just trips over your stderr redirection inside of the brackets.greywolf wrote:The error message is "couldn't parse this test expression".
[ expr ]
is another way of writing test expr
; any redirection concerns the output of "test": is not part of the test expression and should as such be placed outside of the square brackets. Bash and dash accept it no doubt as an explicit compatibility issue with Olden Days but seems that "shellcheck" does not.