On Sun, Apr 14, 2024 at 11:16:27AM +0200, Emanuel Attila Czirai wrote: > $ [ -n ">" -a -n "something" ] || echo hmm > bash: [: syntax error: `-n' unexpected > hmm
Don't do this. You're in the land of unspecified behavior here. Use multiple test or [ commands instead, or use bash's [[ command. [ -n ">" ] && [ -n "something" ] [[ -n ">" && -n "something" ]] > Note, the issue is present also in (current latest) FreeBSD's '/bin/sh' and > 'bash' and `/bin/[`. That's because they all try to implement the POSIX rules. > But doesn't happen on Gentoo's /usr/bin/[ which is from > sys-apps/coreutils-9.5::gentoo Who knows what that one does.