So I have (what I think to be) an interesting question.
At work I test/configure an ethernet device we make with a proprietary command line utility.
Basically, you open up a command prompt, type ethutil
in the appropriate directory, and then it access the chip via JTAG.
Within this utility, you can run "scripts" that are just text files filled with appropriate commands. They are run like this:
-->run test_script.txt
This will then spit out the feedback to all the commands in the script.
I've taken to automating a lot of register writes/reads by piping commands to the utility with a batch file, like so:
type run test_script.txt | ethutil >nul
The nul
is there just to supress all the output in my batch readout. This works very well, but I always get an error saying that the file can't be found:
The system cannot find the file specified.
Error occurred while processing: run.
test_script.txt
Before going forward, it should be noted that this error does not occur if I just run the script from within the utility itself (i.e. no batch script).
Now I've tried surpressing the error like this:
type run test_script.txt | ethutil >nul 2>&1
But the error still shows up, so it's clearly not part of stderr
.
Also, if I replace nul
with a log file, the errors do not show up in the log file.
So my questions are: is there a way to figure out why this error shows up when I run the batch script? If it's not part of stderr
or stdout
, what is it a part of? Is it even possible to know what it is a part of?
Thanks in advance.
P.S. I understand that this is probably just a quirk with the proprietary software, but I figured I would ask if it may have something to do with Windows.
type
is not echo
.
c:\> type /?
displays the contents of a text file or text files
It complains because run
is not a text file, and (presumably) works reading test_script.txt because it is.
The error is coming from "type"'s stderr, so redirecting ethutil's stderr isn't going to supress it. If you really wanted to you could type run 2>nul | ethutil
but since there is no run
file, it's not working properly/doing what you expect and you should fix it.