While reading REGINA, I saw the following script:
--------------
def listFiles = 'ls'.execute()
def ignoreCase = "tr '[A-Z]' '[a-z]'".execute()
def reverseSort = 'sort -r'.execute()
listFiles | ignoreCase | reverseSort
reverseSort.waitForOrKill(1000)
if(reverseSort.exitValue()) {
print reverseSort.err.text
} else {
print reverseSort.text
}
-------------------
I find this curious. It doesn't even seem to me that this could work as they
intended, although when I run it on Linux, it does apparently print reasonable
output. On Win7/Cygwin however, it prints "-rThe system cannot find the file
specified.". Any idea what's going on here?
Also, the javadoc for "execute()" says that it starts the process and returns
the process object. Ignoring for a moment why it completely fails on Cygwin,
what exactly is the "pipe" line actually doing?