Page 1 of 3

CMD printer output redirection 

Posted: Mon Jul 06, 2015 9:32 pm
by JosDuchIt
Is there a replacement for the CMD tool, that has been with us till OS3.9 (crashes here) ?

Re: CMD printer output redirection 

Posted: Mon Jul 06, 2015 10:38 pm
by broadblues
printtofile.device ?

Re: CMD printer output redirection 

Posted: Tue Jul 07, 2015 12:26 pm
by JosDuchIt
I was able to do redirect Gui4CLI's debug ouput to a file
using the CMD tool/Command
CLI ' run cmd parallel t:G4debug opt n'
Would printer.device allow it too?
I would prefer an OS4 replacement to CMD of course.

Re: CMD printer output redirection 

Posted: Tue Jul 07, 2015 5:33 pm
by broadblues
Hmm CMD was intended for printer redirecting to file IIRC so you are using a side effect, or at least a different usage to my vague google assisted memory, clearly the replacement for that, printtofile.device, that won't work for redirecting debug.


Where is GUI4CLI debug going to? serial? Use Sashimi. Stderr ? use standard redirection.

eg
(assumes you have sashimi in sdk:tools if not get it from os4 depot)
SDK:Tools/Sashimi/Sashimi >mydebugfile

CTRL C to quit sashimi.

or for stderr redriection

Gui4CLI someguiprog *>mydebugfile

Other wise provide mor info on GUi4CLIs debug.

As you maintain it perhaps add an option to dump debug to file directly?

Re: CMD printer output redirection 

Posted: Tue Jul 07, 2015 9:12 pm
by JosDuchIt
@broadblues
perhaps add an option to dump debug to file directly?
That was the intention, but wanted to test first if what i intended it for could be done, or at least to what extend

However i did hit this page
http://wiki.amigaos.net/wiki/AmigaOS_Ma ... r_Programs
it mentionas a tools drawer in which CMD should reside.

I don't have such a drawer, neither on OS4.1FE nor on Upd6
The tools in that drawer are present in the utilities drawer, except
CMD
Lacer
Mounter
Prepcard


Mounter seems to be in system drawer
The other three are absent in my OS4.1 distri's

Re: CMD printer output redirection 

Posted: Tue Jul 07, 2015 10:07 pm
by ssolie
JosDuchIt wrote:However i did hit this page
http://wiki.amigaos.net/wiki/AmigaOS_Ma ... r_Programs
it mentionas a tools drawer in which CMD should reside.
That page was very out of date so I fixed most of it. That is the beauty of a wiki. :)

Most of the information that was on there has been merged into
http://wiki.amigaos.net/wiki/AmigaOS_Ma ... ench_Using

A lot of more editing is required. If anybody else would like to help please go ahead and start editing.

Re: CMD printer output redirection 

Posted: Wed Jul 08, 2015 1:37 pm
by JosDuchIt
@ssolie

OK CMD, lacer, Prepcard are not mentioned here any more, iI don't recall ever having used lacer or prepcard.
CMD: yes i did.
I remember having used CMD a lot for switching some stdout or stderror channel to a file, to catch more easily some produced info.
The normal CLI redirection (>) cannot be set on or off during the execution of the launched program.
So i guess what i am asking: can CMD be brought back?
More support for this request?

Re: CMD printer output redirection 

Posted: Wed Jul 08, 2015 4:29 pm
by ssolie
JosDuchIt wrote:So i guess what i am asking: can CMD be brought back?
I checked and "CMD" was never ported to AmigaOS 4.0. It was probably left behind because it only works on classic Amigas the way it is written. It does this by patching their vectors which is also naughty.

The comments in the source code say this:
"Redirects exec serial or parallel device CMD_WRITEs to a file
(for the purpose of capturing printer output to a file)"

That functionality is now provided by the printer driver "File" which is in your Printer preferences.

Re: CMD printer output redirection 

Posted: Wed Jul 08, 2015 9:34 pm
by broadblues
That functionality is now provided by the printer driver "File" which is in your Printer preferences.
Not quite, File creates a ILBM image and save it file .

printofile.device which you should use instead of serial / paralell / usbprinter etc dumps the output of the printer driver to disk.

Re: CMD printer output redirection 

Posted: Wed Jul 08, 2015 9:37 pm
by JosDuchIt
@ssolies
That functionality is now provided by the printer driver "File" which is in your Printer preferences.
as you may note i seem to have used a side effect of CMD to switch "on the fly" (dring execution of scropts) Gui4cli output from CON: to PRT: or file
using
Set OUTPUT con:360/12/160/80/Gui4Cli/auto/close/wait §Gui4Cli command
CLI 'run cmd parallel PRT: opt n '
CLI ' run cmd parallel RAM:PrtFile opt n' ;
any alternative to that ?

I did observe that U-boot has a stdout env variable which is not of course the one that vould be used,
but setting the OS4. stdout through such an environmental variable would do the job