I'm trying to use the cmd line, eventually putting it into a .bat to run a program, taking the return value and putting it into a .txt file. In this script it runs the program, creates the .txt file, but the .txt file is blank, while the program puts out a bunch of text on one line:
This is the command:
jsonlint test.json -c -q > test1.txt
The test1.txt gets create, but is blank. The program returns this value:
test.json: line 3, col13, found: 'NUMBER' - expected: 'EOF', '}', ':', ',', ']'.**
Why would this return value not be getting saved to the test1.txt file? Any thoughts or ideas are most appreciated. Thank you.
As Charles has mentioned, your output is actually an error indicating that your JSON file
test.jsonis syntactically incorrect on line 3 col 13.If you want to have whatever is output regardless of it being
STDOUTorSTDERR, then at the end of your command you can add2>&1to redirect yourSTDERRtoSTDOUT, so it would look like this:More on redirecting error messages here.