problem with tee

if "%runwith" == "jar" java.exe %JAVA_OPTIONS -ea -jar replacewebsite.jar %configuration |& tee C:\temp\somestores.log

timer off >> C:\temp\somestores.log

the program executes, but when all is done somestores.log just has the timer off line, nothing from replacewebsite.jar. What am I doing wrong?
 

rps

Jul 6, 2008
440
6
Not sure what you are doing exactly , but have you tried using command grouping?


Code:
C:\JPSoft\tcmd20x64>(echo. & echos Cmd and History `log` ===` ` %_hlogfile & echo.) |& tee /a TestLogfile.log

Cmd and History log ===  C:\JPSoft\TCMD20x64\logs\TC13_Jul_2016.log

C:\JPSoft\tcmd20x64>v TestLogfile.log

C:\JPSoft\tcmd20x64>(echo. & echos Cmd and History `log` ===` ` %_hlogfile & echo.) | tee /a TestLogfile.log

Cmd and History log ===  C:\JPSoft\TCMD20x64\logs\TC13_Jul_2016.log

C:\JPSoft\tcmd20x64>type testlogfile.log

Cmd and History log ===  C:\JPSoft\TCMD20x64\logs\TC13_Jul_2016.log

Cmd and History log ===  C:\JPSoft\TCMD20x64\logs\TC13_Jul_2016.log

Without command grouping.
Code:
C:\JPSoft\tcmd20x64>echo. >! TestLogfile.log

C:\JPSoft\tcmd20x64>type testlogfile.log


C:\JPSoft\tcmd20x64>echo. & echos Cmd and History `log` ===` ` %_hlogfile & echo. |& tee /a TestLogfile.log

Cmd and History log ===  C:\JPSoft\TCMD20x64\logs\TC13_Jul_2016.log

C:\JPSoft\tcmd20x64>type testlogfile.log

.. now with the command grouping added ....


Code:
C:\JPSoft\tcmd20x64>(echo. & echos Cmd and History `log` ===` ` %_hlogfile & echo.) |& tee /a TestLogfile.log

Cmd and History log ===  C:\JPSoft\TCMD20x64\logs\TC13_Jul_2016.log

C:\JPSoft\tcmd20x64>type testlogfile.log



Cmd and History log ===  C:\JPSoft\TCMD20x64\logs\TC13_Jul_2016.log
 

rconn

Administrator
Staff member
May 14, 2008
12,557
167
I doubt there's an inherent issue with TEE. I suspect that either your app isn't writing to STDOUT, or (more likely) it's spawning child processes that aren't affected by the pipe & TEE.

If it's the latter problem, then using a command group should solve it.
 

Similar threads