In Bash, the variable - represents stdin for the command and is extremely useful for piping to commands. I was wondering if there was an equivalent in Windows batch files, and I can't seem to find an answer.
Here's what I've traditionally done when absolutely necessary (and it is if
statements where it is most useful):
<command> | set /p tmpvar=
if "%tmpvar%"=="whatever" rem stuff
I feel it would be much quicker and easier to do something like what you could do in Bash. Here's an equivalent script in Bash, which I'm wanting something a bit simpler like this one for Windows batch (DOS compatibility is not required).
<command> | if ("-" == "whatever" ) # stuff
Is there an equivalent simpler than the first example above? It would make things a lot easier.