OS2 World.Com Forum
2012.05.24, 05:03:34
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
Home
Help
Search
Login
Register
OS2 World.Com Forum
>
OS/2 - Technical
>
Utilities
>
How do I redirect output from the .CMD file to a text file.
Pages: [
1
]
« previous
next »
Print
Author
Topic: How do I redirect output from the .CMD file to a text file. (Read 2815 times)
eilygre
Newbie
Posts: 35
How do I redirect output from the .CMD file to a text file.
«
on:
2011.02.24, 00:33:23 »
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
Logged
RobertM
Global Moderator
Hero Member
Posts: 2017
Re: How do I redirect output from the .CMD file to a text file.
«
Reply #1 on:
2011.02.25, 10:23:26 »
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
Logged
|
|
Kirk's 5 Year Mission Continues at:
Star Trek New Voyages
|
|
Andi
Sr. Member
Posts: 251
Re: How do I redirect output from the .CMD file to a text file.
«
Reply #2 on:
2011.02.25, 10:50:42 »
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.
Logged
eilygre
Newbie
Posts: 35
Re: How do I redirect output from the .CMD file to a text file.
«
Reply #3 on:
2011.02.26, 02:07:06 »
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
Logged
CDRWSel
Sr. Member
Posts: 419
Re: How do I redirect output from the .CMD file to a text file.
«
Reply #4 on:
2011.03.04, 07:03:54 »
Fine that you found howto.
Just for information, 2 links about redirection
http://www.robvanderwoude.com/battech_redirection.php
http://www.robvanderwoude.com/redirection.php
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
WebSite Information
-----------------------------
=> Article Discussions
=> Comments, Suggestions & Questions
-----------------------------
OS/2 - General
-----------------------------
=> Events
=> Marketplace
=> Polls
-----------------------------
OS/2 - Technical
-----------------------------
=> Applications
=> Communication
=> Games
=> Hardware
=> Internet
=> Mail-News
=> Multimedia
=> Networking
=> Programming
=> Setup & Installation
=> Utilities
=> Web applications
=> Storage
-----------------------------
OS/2 - SIGs
-----------------------------
=> Abandonware
=> CW-Multimedia
=> Doodle's ScreenSaver
=> Emulators
=> Hobbes Archive
=> ODIN
=> OS2 Petition
=> Rexx
=> Security
=> Socket Service
=> USB
=> XFree86
-----------------------------
OS2 World.Com Bounty System
-----------------------------
=> General Discussion
=> Open Bounties
=> Claimed Bounties
=> Development
-----------------------------
User Groups
-----------------------------
=> OS2 User Groups
=> OS2 User Group Denmark
=> OS2 User Group Germany
=> OS2 User Group Sweden
=> OS2 User Group Southern Europe
-----------------------------
Public Discussions
-----------------------------
=> General Advertisements
=> General Discussion
=> Off Topic discussions
Loading...