1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

problem with tee

Discussion in 'Support' started by Roedy, Jul 10, 2016.

  1. Roedy

    Joined:
    Jun 8, 2008
    Messages:
    120
    Likes Received:
    2
    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?
     
  2. rps

    rps

    Joined:
    Jul 6, 2008
    Messages:
    232
    Likes Received:
    3
    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
    
    
     
  3. rconn

    rconn Administrator
    Staff Member

    Joined:
    May 14, 2008
    Messages:
    10,040
    Likes Received:
    84
    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.
     

Share This Page