Chet Ramey <[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] wrote:
>> Is this a bug?
>>
$ t=test #bash builtin
$ $t -t ' '; echo $?
0
>
> Doesn't look like it:
I think it is a bug, but libc may or may not hide it, depending on the
strtol[l] implementation. SUS says:
# If the subjec
[EMAIL PROTECTED] wrote:
> Is this a bug?
>
>>> $ t=test #bash builtin
>>> $ $t -t ' '; echo $?
>>> 0
Doesn't look like it:
$ ../bash-3.2-patched/bash --version
GNU bash, version 3.2.39(3)-release (i386-apple-darwin9.2.0)
Copyright (C) 2007 Free Software Foundation, Inc.
$ cat x19
test -t 0
echo
Is this a bug?
>> $ t=test #bash builtin
>> $ $t -t ' '; echo $?
>> 0
PJ> That looks like a bug. bash tries to parse a number from the " "
PJ> string and ends up with zero, which is a tty.
Paul Jarc wrote:
> 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.
This is covered in the man page a
[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