Re: manpage note? weird strings that appear to be equal but create haywire comparisons?

2009-09-01 Thread Linda Walsh
Chet Ramey wrote: Note that [[ and [ return different results when the vars are unquoted. Yes. There are two differences. First, the operands in [[ do not undergo all word expansions. The arguments to [, since it's a builtin, do. That doesn't really matter to this example, but it's worth

Re: manpage note? weird strings that appear to be equal but create haywire comparisons?

2009-08-26 Thread Greg Wooledge
On Wed, Aug 26, 2009 at 04:36:42PM +0300, Pierre Gaston wrote: Thanks, I agree with that, I'm sorry I should have been more explicit, what was not clear to me was where this special role of the \ is explained, Because if you use literals [[ something = \* ]] is the same as [[ something = * ]]

Re: manpage note? weird strings that appear to be equal but create haywire comparisons?

2009-08-26 Thread Pierre Gaston
On Wed, Aug 26, 2009 at 4:19 PM, Greg Wooledge wool...@eeg.ccf.org wrote: Assuming the first part was supposed to be var='*' ... yup The bash command [[ \* = $var ]] returns true if $var contains a glob pattern against which a literal asterisk * can be matched. (By the way, you don't need

Re: manpage note? weird strings that appear to be equal but create haywire comparisons?

2009-08-26 Thread Linda Walsh
Greg Wooledge wrote: On Wed, Aug 26, 2009 at 02:45:39AM -0700, Linda Walsh wrote: I had a var 'c' set to (no quotes in the var): 'C\windows\system32' How did you assign this value? Did you read it from a file? Did you type a specific bash command? -- I typed it in at the prompt as:

Re: manpage note? weird strings that appear to be equal but create haywire comparisons?

2009-08-26 Thread Chet Ramey
Linda Walsh wrote: But then I tested equality on the strings and that's the confusing part. I have an idea of what's going on but boy do string compares look confused. They perform same on cygwin (bashv=3.2.49(22)-release (i686-pc-cygwin)) and Suse11.1: (bashv=3.2.39(1)-release