4 ms·
I think this is just how operator overloading works in Groovy: https://groovy-lang.org/operators.html#Operator-Overloading https://groovy-lang.org/operators.htm
by tkot 5y ago
I think this is just how operator overloading works in Groovy:
https://groovy-lang.org/operators.html#Operator-Overloading https://groovy-lang.org/operators.html#Operator-Overloading
"Or" is the name of the "|" operator.
From the looks of it it's impossible to overload "||" in groovy.
By the way the "|" operator and the "or" method both call "pipeTo" directly so a third way to write it would be:
"ls".execute().pipeTo("grep -i old".execute()).waitForProcessOutput(System.out, System.out)