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
Em (02:25:11), Andreas Schwab escreveu:
>Herculano Einloft writes:
>
>> Hey all,
>>
>> $ if $(echo string >/dev/null); then echo true; fi
>> true
>>
>> This should be a syntax error
>
>No, it is a perfectly valid command, syntactically. That the command
>substitution expands to nothing
Em (21:43:32), Mike Frysinger escreveu:
>On Saturday 15 April 2006 19:55, Herculano Einloft wrote:
>> $ if $(echo string >/dev/null); then echo true; fi
>> true
>>
>> This should be a syntax error, since
>>
>> $ if; then echo true; fi
>> bash: syntax error near unexpected token `;'
>
>th
Em (02:25:11), Andreas Schwab escreveu:
>
>> Hey all,
>>
>> $ if $(echo string >/dev/null); then echo true; fi
>> true
>>
>> This should be a syntax error
>
>No, it is a perfectly valid command, syntactically. That the command
>substitution expands to nothing has no significance any more
On Saturday 15 April 2006 19:55, Herculano Einloft wrote:
> $ if $(echo string >/dev/null); then echo true; fi
> true
>
> This should be a syntax error, since
>
> $ if; then echo true; fi
> bash: syntax error near unexpected token `;'
the first command statement is more like:
if :; then echo true;
Herculano Einloft <[EMAIL PROTECTED]> writes:
> Hey all,
>
> $ if $(echo string >/dev/null); then echo true; fi
> true
>
> This should be a syntax error
No, it is a perfectly valid command, syntactically. That the command
substitution expands to nothing has no significance any more once the
c
Hey all,
$ if $(echo string >/dev/null); then echo true; fi
true
This should be a syntax error, since
$ if; then echo true; fi
bash: syntax error near unexpected token `;'
Tested on
GNU bash, version 2.05b.0(1)-release (i386-pc-linux-gnu)
Copyright (C) 2002 Free Software Foundation, In
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
Hello,
Below is the report I sent via bashbug from my root account on the HP-UX system
in question, but email is only setup for forwarding on that system; hence, I am
sending the bashbug report via my regular email account.
Regards,
--John Lanier
Below is from the bashbug report:
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
Mike Frysinger wrote:
> On Friday 14 April 2006 22:52, Chet Ramey wrote:
>>>
>>> foo=$( #'
>>> echo hi)
>> This has already been fixed for the next version.
>
> when you say "next version" you mean like bash-3.2 right ?
Yeah, I mean like bash-3.2. :-)
Chet
--
``The lyf so short, the craft so
16 matches
Mail list logo