How to quit programs from a script?
  • rms
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    rms
    Posts: 602 from 2004/11/27
    Hi,

    I need to quit a program (it's PolyOrganiser) from/in a script befor the script does it's jop. In fact I installed an automatic backup solution with MirrorCopy and CronTab, so the System partition is automatically "mirrored" every night but if Polyorganiser is running the script stops and gives back an error.

    Can anyone help me please?

    Regards

    Christoph
  • »04.10.08 - 16:13
    Profile Visit Website
  • rms
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    rms
    Posts: 602 from 2004/11/27
    @ jPV

    thanks for your feed-back in this matter!

    It seems that I'm not able to quit PolyOrganiser with a script though :-( I can start it allright with the following script:

    /* */

    Address command

    IF ~Show("P", "ORGA") THEN "run System:PolyOrga/Orga"

    Exit


    but I didn't find the solution to quit the program. I tried this:

    /* */

    rxcmd ORGA.1 QUIT

    Exit


    but it doesn't work.


    Could you give me a hint please?

    Thanks in advance

    Christoph
  • »08.10.08 - 14:46
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    tokai
    Posts: 1289 from 2003/2/25
    From: binaryriot
    RXCmd is a DOS command and not an ARexx function.

    With RXCmd you can send a single ARexx command to a specified port w/o invoking the ARexx scripting engine at all.

    If you already have an ARexx script there you just can send 'QUIT' command directly.

    regards,
    tokai
  • »08.10.08 - 15:17
    Profile Visit Website
  • Targhan
    Posts: 2833 from 2003/2/8
    From: USA
    It's as tokai says:
    Code:
    rxcmd ORGA.1 QUIT
    would be something from a shell, or DOS script. Try the following instead:

    Code:

    /**/
    address ORGA.1
    QUIT
    exit



    Keep in mind that when you are using arexx to send a command to a program, than you have to *ADDRESS* that program's port. RxCmd, as suggested by JPV, could be very useful if you like using DOS scripts--since you could use LIST and RegEx.

    [ Edited by Targhan on 2008/10/8 10:19 ]
    :idea:Targhan

    MorphOS portal? www.MorphZone.org
  • »08.10.08 - 16:09
    Profile Visit Website
  • MorphOS Developer
    CISC
    Posts: 619 from 2005/8/27
    From: the land with ...
    Quote:

    RxCmd, as suggested by JPV, could be very useful if you like using DOS scripts--since you could use LIST and RegEx.


    Not to mention that you can use it without having the original rexxsyslib.library installed...


    - CISC
  • »09.10.08 - 07:12
    Profile
  • rms
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    rms
    Posts: 602 from 2004/11/27
    Hi all,

    thanks very much for all your help :-) Everything works fine now and my System partition gets "mirrored" automatically every night.

    Regards

    Christoph
  • »09.10.08 - 12:25
    Profile Visit Website
  • MorphOS Developer
    Henes
    Posts: 507 from 2003/6/14
    "breakname" or maybe also "break" itself work with apps with no rexx port
  • »10.10.08 - 13:07
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    jcmarcos
    Posts: 1178 from 2003/3/13
    From: Pinto, Madrid ...
    Quote:

    Henes wrote:

    "breakname" or maybe also "break" itself work with apps with no rexx port


    Yes, but only for console applications that specifically listen for "Control-C" or "Control-D" keyboard sequences?
  • »13.10.08 - 07:15
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Wishmaster
    Posts: 342 from 2003/6/29
    Quote:


    jcmarcos wrote:

    Yes, but only for console applications that specifically listen for "Control-C" or "Control-D" keyboard sequences?


    All programs, which are listening to CTRL-C.

    [ Edited by Wishmaster on 2008/10/21 11:56 ]
    Pegasos PPC
  • »20.10.08 - 09:10
    Profile