fix "test: 2: unexpected operator" on bsd