man test:"INTEGER may also be -l STRING, which evaluates to the length of STRING." bash-2.05b$ test [ -l "bla" -ge 4 ] bash: test: too many arguments also, info test doesn't list the "-l" switch. Reproducible: Always Steps to Reproduce: 1.test [ -l "bla" -ge 4 ] 2. 3. Actual Results: test: too many arguments Expected Results: $?=1 It looks like the manpage is outdated
Actually, there are multiple levels of user error in play here. First, by default when you call "test" at the command-line, you get the bash builtin version. The bash builtin version is documented in the bash man-page and also via "help test" To get the external version, i.e. the version that comes with coreutils and is documented in test(1), you need to call it explicitly: /usr/bin/test 3 -eq -l "abc" Second, you're misusing the command. /usr/bin/test and /usr/bin/[ are the same command. Never should you be calling "test [ ... ]", rather you do either "test ..." or "[ ... ]" Finally, all of these things are in fact documented in "info test"; I just checked.