Re: Bash is broken

2007-05-13 Thread Chris F.A. Johnson
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

Re: Bash is broken

2007-05-13 Thread Stephane Chazelas
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

Re: Bash is broken

2007-05-13 Thread Stephane Chazelas
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

Re: Bash is broken

2007-05-13 Thread Eric Blake
-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

Bash is broken

2007-05-13 Thread Overdorf, Sam
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 ___