It seems like there is some strange behavior if you type the text literally in the if statement, e.g.:

Code:
alias test1 {
  if (a & c iswm a b c) { echo -a yes }
  else { echo -a no }
  ; this alias will echo "no"
}

alias test2 {
  var %a = a & c
  var %b = a b c
  if (%a iswm %b) { echo -a yes }
  else { echo -a no }
  ; this alias will echo "yes"
}


The first alias, test1, will echo "no", while the second alias, test2, will echo "yes". My guess is that it is treating the & as the bitwise comparison operator in the first one.

However, even when placing it inside a variable, only the "a & b" and "a& b" constructs work. "a &b" and "a&b" will not match at all.

Now that we understand what works and what doesn't work, I'd propose that this wildcard SHOULD match on any non-empty combination of non-space characters. This would give it meaning both with or without spaces to either side of it. I don't see any reason to limit its usefulness to only cases where spaces are present on either side of the wildcard character.

Last edited by drum; 08/06/10 04:00 PM.