Skip to content

does not accept windows redirect commands #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rdeltour opened this issue Oct 15, 2013 · 5 comments
Closed

does not accept windows redirect commands #17

rdeltour opened this issue Oct 15, 2013 · 5 comments
Labels
type: bug The issue describes a bug type: not an issue The issue is rejected (not an actual issue or not relevant)

Comments

@rdeltour
Copy link
Member

From [email protected] on August 07, 2008 20:27:03

PROBLEM: If the program is ran from the Windows command line, the output cannot be
re-directed to a text file. METHOD: What steps will reproduce the problem? 1. Run the program from the command line and add the redirect symbol and
the name of the file to re-direct output to.
Sample code: "java -jar epubcheck.jar file.epub > results.txt"
2. Press Enter RESULT: The output is displayed on screen, and the output file is created, but empty. EXPECTED: The output of the program that normally displays on screen should be inside
the output text file. PLATFORM: epubcheck RC 1

OS: Windows XP Service Pack 2 ADDITIONAL INFO: The results are the same if ran from a Windows batch file.
A sample batch file is attached.

Attachment: epubcheck.bat

Original issue: http://code.google.com/p/epubcheck/issues/detail?id=17

@rdeltour
Copy link
Member Author

From [email protected] on August 11, 2008 09:55:22

i can get non-error outputs to go to a text file using '>>', but errors seem to go
straight to the screen and not show in the text file.

I'm calling the epubcheck tool from perl so i can process an entire directory, and
although its easy enough to copy and paste the errors, it would make life easier to
be able to pipe the error output.

Attachment: check.bat

@rdeltour
Copy link
Member Author

From [email protected] on August 11, 2008 10:55:34

Hello,
Your problem occurs because by default, only stdout (standard output - System.out.print) is redirected by the
redirection arrow operator (>). Epubcheck, however, uses stderr (standard error output - System.err.print) to
display errors to console.
If you want to have stderr (only) redirected to file, use the error redirection arrow operator (2>) instead.
If you want to have both stdout and stderr in the file, use the redirection arrow operator (>), but add this as
an argument after the file name: 2>&1 This will let redirect both outs to your text file. For the sake of clarity,
here is an example:

STDOUT only:
java -jar epubcheck.jar test_epub.epub > logfile.txt

STDERR only:
java -jar epubcheck.jar test_epub.epub 2> logfile.txt

STDOUT & STDERR
java -jar epubcheck.jar test_epub.epub > logfile.txt 2>&1

Hope that solves your problem!

Piotr

Status: Invalid

@rdeltour
Copy link
Member Author

From [email protected] on August 11, 2008 11:00:28

Thanks, it seems to work.

@rdeltour
Copy link
Member Author

From [email protected] on August 11, 2008 09:55:22

i can get non-error outputs to go to a text file using '>>', but errors seem to go
straight to the screen and not show in the text file.

I'm calling the epubcheck tool from perl so i can process an entire directory, and
although its easy enough to copy and paste the errors, it would make life easier to
be able to pipe the error output.

Attachment: check.bat

@rdeltour
Copy link
Member Author

From [email protected] on August 11, 2008 10:55:34

Hello,
Your problem occurs because by default, only stdout (standard output - System.out.print) is redirected by the
redirection arrow operator (>). Epubcheck, however, uses stderr (standard error output - System.err.print) to
display errors to console.
If you want to have stderr (only) redirected to file, use the error redirection arrow operator (2>) instead.
If you want to have both stdout and stderr in the file, use the redirection arrow operator (>), but add this as
an argument after the file name: 2>&1 This will let redirect both outs to your text file. For the sake of clarity,
here is an example:

STDOUT only:
java -jar epubcheck.jar test_epub.epub > logfile.txt

STDERR only:
java -jar epubcheck.jar test_epub.epub 2> logfile.txt

STDOUT & STDERR
java -jar epubcheck.jar test_epub.epub > logfile.txt 2>&1

Hope that solves your problem!

Piotr

Status: Invalid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug The issue describes a bug type: not an issue The issue is rejected (not an actual issue or not relevant)
Projects
None yet
Development

No branches or pull requests

1 participant