Chet Ramey wrote:
> Bob Proulx wrote:
> > As an alternative, you could use the [[ ... ]] syntax. That is the
> > newer syntax, covered in POSIX too so should be portable to POSIX
> > systems, but is always a built-in to the shell.
>
> POSIX declined to standardize [[...]]. It just happens to app
Bob Proulx wrote:
> As an alternative, you could use the [[ ... ]] syntax. That is the
> newer syntax, covered in POSIX too so should be portable to POSIX
> systems, but is always a built-in to the shell.
POSIX declined to standardize [[...]]. It just happens to appear in
`posix shells' descend
Charlie Bennett wrote:
> H. I sat on that blasted committee.
:-)
> I'll file a corrigendum or whatever it's called. This should at
> least be called out in the rationale.
>
> No biggie. I'll just make sure I quote all of my args.
Yes, because test and [ were external commands when the AP
H. I sat on that blasted committee.
I'll file a corrigendum or whatever it's called. This should at
least be called out in the rationale.
No biggie. I'll just make sure I quote all of my args.
ccb
> Charlie Bennett wrote:
>> Is this expected behavior?
>>
>> [EMAIL PROTECTED] .ssh]# [ -
Charlie Bennett <[EMAIL PROTECTED]> wrote:
> Is this expected behavior?
>
> [EMAIL PROTECTED] .ssh]# [ -f ]
> [EMAIL PROTECTED] .ssh]# echo $?
> 0
Yes. A single argument is considered true if it is not the mepty
string, even if it happens to coincide with the spelling of an
operator. This is ho
Charlie Bennett wrote:
> Is this expected behavior?
>
> [EMAIL PROTECTED] .ssh]# [ -f ]
> [EMAIL PROTECTED] .ssh]# echo $?
> 0
Yes. That is expected behavior. With one argument the return code is
true if the string is non-zero in length. The case covered is this
case:
if [ "$variable" ]; t
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
According to Charlie Bennett on 4/14/2006 9:17 AM:
> Is this expected behavior?
>
> [EMAIL PROTECTED] .ssh]# [ -f ]
> [EMAIL PROTECTED] .ssh]# echo $?
> 0
Yes. POSIX requires 'test' (aka '['), when handed exactly one argument,
to return 0 if it is
I'm running bash 3.0. I'm seeing the same thing in
the Fedora 4 distributed version and in a copy built
from the stable tarball.
Is this expected behavior?
[EMAIL PROTECTED] .ssh]# [ -f ]
[EMAIL PROTECTED] .ssh]# echo $?
0
All of the file test ops behave the same way.
in test.c, we call pos