On 7/8/23 3:18 AM, Stephane Chazelas wrote:
2023-07-07 15:52:28 -0400, Chet Ramey:
[...]
Historical versions of test made the argument to -t optional here. I can
continue to support that in default mode for backwards compatibility, but
it will be an error in posix mode.
[...]
I think you may h
2023-07-07 15:52:28 -0400, Chet Ramey:
[...]
> Historical versions of test made the argument to -t optional here. I can
> continue to support that in default mode for backwards compatibility, but
> it will be an error in posix mode.
[...]
I think you may have overlooked the bottom part of my email
On 7/6/23 2:29 AM, Stephane Chazelas wrote:
Hello,
Thanks for the report.
test -t X
Always returns false and doesn't report an error about that
invalid number (beside the point here, but in ksh/zsh, that X is treated
as an arithmetic expression and evaluates to 0 if $X is not set).
Hello,
test -t X
Always returns false and doesn't report an error about that
invalid number (beside the point here, but in ksh/zsh, that X is treated
as an arithmetic expression and evaluates to 0 if $X is not set).
While:
test -t X -a Y
returns a "too many arguments" error.
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 Fr
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
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:
$ test -t
The answer is it always returns true, no matter what. Test with
$ ec
10 matches
Mail list logo