CMD printer output redirection 

AmigaOS users can make feature requests in this forum.
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

CMD printer output redirection 

Post by JosDuchIt »

Is there a replacement for the CMD tool, that has been with us till OS3.9 (crashes here) ?
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: CMD printer output redirection 

Post by broadblues »

printtofile.device ?
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: CMD printer output redirection 

Post 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.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: CMD printer output redirection 

Post 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?
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: CMD printer output redirection 

Post 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
User avatar
ssolie
Beta Tester
Beta Tester
Posts: 1010
Joined: Mon Dec 20, 2010 8:51 pm
Location: Canada
Contact:

Re: CMD printer output redirection 

Post 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.
ExecSG Team Lead
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: CMD printer output redirection 

Post 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?
User avatar
ssolie
Beta Tester
Beta Tester
Posts: 1010
Joined: Mon Dec 20, 2010 8:51 pm
Location: Canada
Contact:

Re: CMD printer output redirection 

Post 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.
ExecSG Team Lead
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 600
Joined: Sat Jun 18, 2011 2:40 am
Location: Portsmouth, UK
Contact:

Re: CMD printer output redirection 

Post 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.
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: CMD printer output redirection 

Post 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
Post Reply