• Welcome to OS2World OLD-STATIC-BACKUP Forum.
 

News:

This is an old OS2World backup forum for reference only. IT IS READ ONLY!!!

If you need help with OS/2 - eComStation visit http://www.os2world.com/forum

Main Menu

How do I redirect output from the .CMD file to a text file.

Started by eilygre, 2011.02.24, 00:33:23

Previous topic - Next topic

eilygre

The answer should be simple:  xxx.cmd > txt.log or something like that, and the output will end up in the txt.log file, but it does not.
I am running GenealogyJ, a Java program. When starting it from a command file it first open an OS2-box and display lot of lines before it displays a splash screen and then open the graphical interface. That is normal.
I should like to see the content from the os2-box in a txt-file. I use the method mentioned, but the only text in the text file is the content in the cmd-file itself. All the lines that was displayed in the os2-box are not there, and the os2-box itself is not displayed. I have tried different methodes like xxx.cmd 2> txt.log or xxx.cmd 1> txt.log, and then I get some (error) messages in the log-file and the program is not started.
Is it at all possible to have the text printed in a text-file in this case?

Thank you for any help.

Einar

RobertM

OS/2 apps can write to stdout and stderr. They are both different, even though in a vio app it appears to be the same thing (ie: write them to the vio console). You must direct them both to output files or "skip-direct" one while directing the other to an output file. I believe the OS/2 CMD Reference has tips on how to do it. If not, you should dig up "REXX Tips and Tricks", open it with the helpfile viewer and look up "stderr" for tips on how to handle both console output streams.

If you cant find it, let me know and I will post detailed instructions tomorrow... but right now, I'm off to an onsite.

Best,
Rob


|
|
Kirk's 5 Year Mission Continues at:
Star Trek New Voyages
|
|


Andi

Not sure what you need, but maybe 'prog.exe 1&2>output.txt' is of any help.

AFAIR there was a hint about stdout/stderr problems in the Java6 beta readme. Maybe there's something about starting java applications from console window too.

eilygre

Thank you both of you.
I found the exact info under "Rexx Tips and Tricks". The solution is: "xxx.cmd 2>>errFile 1>>&2"

Einar