:I= and :X= confusion
Added by Arseny Kapoulkine 8 months ago
I was under impression that :I= and :X= should split the list in two disjoint sets such that their union is equal to the original one. However, the following code
TEST = a b c d ;
Echo $(TEST) ;
Echo $(TEST:I=a) ;
Echo $(TEST:X=a) ;
prints a b c d for the first line and a for the second (as expected), but the third line is blank.
For now I'm working around this with LIST -= LIST operator, but I'd like to know whether this is a bug or I'm not understanding the :X= behavior.
Replies (3)
RE: :I= and :X= confusion
-
Added by Joshua Jensen 8 months ago
I have confirmed that using :X on its own without :I will yield the results you have above. It turns out all of my tests only use :X coupled with :I.
This works:
Echo $(TEST:I=.*:X=a) ;
I'll look into a fix for a standalone :X. I agree it should reflect the behavior you specify above.
Josh
(1-3/3)