[EMAIL PROTECTED] wrote:
> On (info "(coreutils)File type tests", and test(1) man page, we see
>   `-t FD'
>        True if FD is a file descriptor that is associated with a terminal.
>
> Well please mention what happens if FD is omitted:

bash's "help test" explains this, if you know where to look:
    String operators:
...
        STRING         True if string is not empty.

Similar language is in bash's man page and coreutils' info
documentation.  But it wouldn't hurt to add a note to indicate that if
no operand is provided, then "-t" and other operators stop being
operators, and are tested as plain strings.

> $ t=test #bash builtin
> $ $t -t ' '; echo $?
> 0

That looks like a bug.  bash tries to parse a number from the " "
string and ends up with zero, which is a tty.


paul


Reply via email to