On 2007-05-13, Overdorf, Sam wrote:
> The following does not work on my computers:
>
>
>
> If [ "1" > "2" ]
>
> then
>
> echo "greater"
>
> else
>
> echo "not greater"
>
> fi
>
>
>
> Bash thinks this is I/O redirection and creates a file by the name of
> "2" in my directory.
>
> Thi
On Sun, May 13, 2007 at 08:19:13AM -0600, Eric Blake wrote:
[...]
> if [[ 1 > 2 ]]
>
> > This should be a string compare.
>
> Actually, when quoted properly, it should be a numeric comparison, not a
> string comparison.
[...]
It *is* a string comparison:
$ bash -c '[[ 02 > 1 ]]' || echo "02 is
On Sun, May 13, 2007 at 12:31:48AM -0700, Overdorf, Sam wrote:
> The following does not work on my computers:
[...]
> If [ "1" > "2" ]
[...]
> Bash thinks this is I/O redirection and creates a file by the name of
> "2" in my directory.
>
> This should be a string compare.
[...]
Hi. No, this shoul
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
According to Overdorf, Sam on 5/13/2007 1:31 AM:
> The following does not work on my computers:
>
>
>
> If [ "1" > "2" ]
>
> then
Your mailer corrupted what you typed, by adding spurious newlines, and
capitalizing the if.
Your report is not a
The following does not work on my computers:
If [ "1" > "2" ]
then
echo "greater"
else
echo "not greater"
fi
Bash thinks this is I/O redirection and creates a file by the name of
"2" in my directory.
This should be a string compare.
Thanks,
Sam
___