Ok, this works perfectly well in any flavour of UNIX or Linux if you hard code what you are looking for. In other words, "<" rather than "%1". It even works on Windows with a shell like Cygwin.
I have to further improve this to pass in what I am looking for to the command file. Straightforward, I think, in Unix. More difficult in Windows.
Any suggestions on how to complete the command file, welcome.