0

I'm running a validation software and I want all of the output sent to a text file and have the results of multiple files placed/appended to the same file. I thought my code was working, but I just discovered I'm only getting the results from 1 file output to the text file.

java -jar /Applications/epubcheck-3.0.1/epubcheck-3.0.1.jar ~/Desktop/Validator/*.epub 2>&1 | tee -a ~/Desktop/Validator/EPUBCHECK3_results.txt

open ~/Desktop/Validator/EPUBCHECK3_results.txt

EDIT

When I run the same .jar file using Windows command line it will process a batch of files and appeand the results appropriately. I would just do this, but it would mean having to switch work stations and transferring files to validate them. I would like to get this running through the Unix shell on my Mac system so that I don't have to do unnecessary work. Command line that IS working below:

FOR /f %%1 in ('dir /b "C:\Users\scrawfo\Desktop\epubcheck\drop epubs here\*.epub"') do (
echo %%1 >> epubcheck.txt
java -jar "C:\Users\scrawfo\Desktop\epubcheck\epubcheck-3.0.jar" "C:\Users\scrawfo\Desktop\epubcheck\drop epubs here\%%1" 2>> epubcheck.txt
echo. >> epubcheck.txt)
notepad epubcheck.txt
del epubcheck.txt
I Dabble
  • 321
  • 2
  • 11

1 Answers1

0

syntax provided by you is correct there might be some problem with java output or something Try Executing it without redirection

cat test

Output:-

This is Test File ...............

Next Executed Command with same syntax

ps l 2>&1 | tee -a test

Output:-

F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND 4 0 3287 1 20 0 4060 572 n_tty_ Ss+ tty2
0:00 /sbin/mingetty /dev/tty2 4 0 3289 1 20 0 4060 572 n_tty_ Ss+ tty3 0:00 /sbin/mingetty /dev/tty3 4 0 3291
1 20 0 4060 576 n_tty_ Ss+ tty4 0:00 /sbin/mingetty /dev/tty4 4 0 3295 1 20 0 4060 576 n_tty_ Ss+ tty5
0:00 /sbin/mingetty /dev/tty5 4 0 3297 1 20 0 4060 572 n_tty_ Ss+ tty6 0:00 /sbin/mingetty /dev/tty6 4 0 19086
1 20 0 4060 572 n_tty_ Ss+ tty1 0:00 /sbin/mingetty /dev/tty1 4 0 20837 20833 20 0 108432 2148 wait Ss pts/0
0:00 -bash 4 0 21471 20837 20 0 108124 1036 - R+ pts/0 0:00 ps l 0 0 21472 20837 20 0 100908 664 pipe_w S+ pts/0
0:00 tee -a test

Checked File

cat test

Output:-(Appended properly)

This is Test File ...............

F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND 4 0 3287 1 20 0 4060 572 n_tty_ Ss+ tty2 0:00 /sbin/mingetty /dev/tty2 4 0 3289 1 20 0 4060 572 n_tty_ Ss+ tty3 0:00 /sbin/mingetty /dev/tty3 4 0 3291
1 20 0 4060 576 n_tty_ Ss+ tty4 0:00 /sbin/mingetty /dev/tty4 4 0 3295 1 20 0 4060 576 n_tty_ Ss+ tty5
0:00 /sbin/mingetty /dev/tty5 4 0 3297 1 20 0 4060 572 n_tty_ Ss+ tty6 0:00 /sbin/mingetty /dev/tty6 4 0 19086
1 20 0 4060 572 n_tty_ Ss+ tty1 0:00 /sbin/mingetty /dev/tty1 4 0 20837 20833 20 0 108432 2148 wait Ss pts/0
0:00 -bash 4 0 21471 20837 20 0 108124 1036 - R+ pts/0 0:00 ps l 0 0 21472 20837 20 0 100908 664 pipe_w S+ pts/0
0:00 tee -a test

Vasanta Koli
  • 401
  • 3
  • 6
  • I ran the command without redirecting the output to another file and it is still only evaluating one of the files in the directory. What I need to to do is evaluate all *.epub files in the directory and give me the output for all of them – I Dabble Apr 04 '14 at 15:24
  • Can You share the output – Vasanta Koli Apr 04 '14 at 15:33
  • Epubcheck Version 3.0.1 Validating against EPUB version 2.0 ERROR: /Users/scrawfo/Desktop/Validator/?????????????.epub/OEBPS/toc.ncx(21,45): assertion failed: different playOrder values for navPoint/navTarget/pageTarget that refer to same target ERROR: /Users/scrawfo/Desktop/Validator/?????????????.epub/OEBPS/toc.ncx(27,45): assertion failed: different playOrder values for navPoint/navTarget/pageTarget that refer to same target Check finished with warnings or errors – I Dabble Apr 04 '14 at 15:35