fix '[: ==: unary operator expected' errors