Redirection in Shell()

@fpy

That was a good question. I ran

Shell("cmd /C ""type " & strPath & "\test.txt | find /I """"returns"""" > " & strPath & "output.txt""", 2,, True)

and the lines in test.txt containing “returns” showed up in output.txt. So it seems like Shell has a problem with clip, but not w/ the pipe.

I selected my own post as the solution because it answers the original question. But the credit should go to @fpy for asking the critical question.

For the larger question of how to make Http HEAD requests, a python library could be embedded in the document, which would be superior to using external files. But the code in the LO documentation that explains how to access python scripts in Basic doesn’t work & it’s not obvious how to fix it. Code I’ve seen elsewhere also doesn’t work. Alternately, someone at the OO forum has posted Basic routines that use UNO to make Http requests, w/ no external code libraries. But it also doesn’t work, at least not on my computer. & finally there’s the OAuth2OOo extension. I haven’t tried it yet. Assuming it works, it requires an external file, which is still superior to my original solution requiring 2 external files. Also, it gives me more control over the Http requests.
While I was typing this, I discovered that I can run curl in cmd. But we’ve established that Shell doesn’t like clip, so yet another solution w/ problems.

you may find this one more inspiring : A funny observation related to the connection object

probably a side effect to explore :
Shell Function > image Parameter Windowstyle is only effective on Windows systems…

OAuth2OOo CASA certification

further testing