• Arexx noob needs help

    From Joacim Melin@2:201/120 to All on Mon Jan 8 20:03:31 2018
    Hi All,

    I'm trying to create a ARexx script that ever X number of minutes will execute a shell script. I'm a total noob to ARexx programming but here are my efforts so far:

    * testscript för loop */
    do forever
    if ~show('L','rexxsupport.library') then
    call addlib('rexxsupport.library',0,-30)
    'execute s:hej.scr >Env:minoutput'
    call delay(250)
    end

    s:hej.scr contains one line:

    echo HELLO!

    Now, I get no output from s:hej.scr. I tried to add GetEnv("minoutput") to the ARexx script but that doesn't work. Also, I can't kill the ARexx script once it's running, either by pressing ctrl-c or trying to close the shell window.

    Can anyone explain what I'm doing wrong here?

    Thanks,

    Joacim


    --- NiKom v2.3.1
    * Origin: Delta City (deltacity.se, Vallentuna, Sweden) (2:201/120.0)
  • From Ingo Juergensmann@2:2452/413 to Joacim Melin on Mon Jan 8 21:07:36 2018
    Hello Joacim!

    08 Jan 18 20:03, you wrote to all:

    I'm trying to create a ARexx script that ever X number of minutes will execute a shell script. I'm a total noob to ARexx programming but
    here are my efforts so far:

    * testscript för loop */

    I can't comment on the ARexx script, but when you want to execute a script every x minutes, why don't you just use a cron for AmigaOS? I used to use cybercron for that purpose.

    s:hej.scr contains one line:
    echo HELLO!
    Now, I get no output from s:hej.scr. I tried to add
    GetEnv("minoutput") to the ARexx script but that doesn't work. Also,
    I can't kill the ARexx script once it's running, either by pressing
    ctrl-c or trying to close the shell window.

    Silly question: did you added the script bit to the file? protect +s s:hey.scr

    Ingo


    --- GoldED+/LNX 1.1.5--b20170303
    * Origin: AmigaXess - back in FidoNet after 17 years (2:2452/413)
  • From mark lewis@1:3634/12.73 to Joacim Melin on Mon Jan 8 19:31:40 2018

    On 2018 Jan 08 20:03:30, you wrote to All:

    * testscript för loop */
    do forever
    if ~show('L','rexxsupport.library') then
    call addlib('rexxsupport.library',0,-30)
    'execute s:hej.scr >Env:minoutput'
    call delay(250)
    end

    Can anyone explain what I'm doing wrong here?

    think about your logic... for example, how many times are you going to load that rexxsupport.library? load it once... before the do loop... also, use proper indention... spaces, not tabs, preferrably... i can't tell much of your loop but i can see this part...

    * testscript för loop */
    do forever
    if ~show('L','rexxsupport.library') then
    call addlib('rexxsupport.library',0,-30)
    'execute s:hej.scr >Env:minoutput'
    call delay(250)
    end

    i'm not sure if the "end" statement goes with the "do" or the "if"... proper indention will show you the flow of the code...


    )\/(ark

    Always Mount a Scratch Monkey
    Do you manage your own servers? If you are not running an IDS/IPS yer doin' it wrong...
    ... Cats & Dogs are Household Schedulers
    ---
    * Origin: (1:3634/12.73)
  • From Joacim Melin@2:201/120 to Ingo Juergensmann on Tue Jan 9 07:57:09 2018
    Hello Joacim!

    08 Jan 18 20:03, you wrote to all:

    I'm trying to create a ARexx script that ever X number of minutes will
    execute a shell script. I'm a total noob to ARexx programming but
    here are my efforts so far:

    * testscript för loop */

    I can't comment on the ARexx script, but when you want to execute a
    script every x minutes, why don't you just use a cron for AmigaOS? I
    used to use cybercron for that purpose.

    s:hej.scr contains one line:
    echo HELLO!
    Now, I get no output from s:hej.scr. I tried to add
    GetEnv("minoutput") to the ARexx script but that doesn't work. Also,
    I can't kill the ARexx script once it's running, either by pressing
    ctrl-c or trying to close the shell window.

    Silly question: did you added the script bit to the file? protect +s s:hey.scr

    Ingo

    A fair question. :) CronTab does not work properly with the ACA1221ec accelerator card. I have tried many a Crontab software for the Amiga and they all launch just fine but never executes anything when it's supposed to execute.
    So I thought I would solve it this way - have a ARexx program execute something every 30 or 60 minutes or whatever and just loop itself.

    "protect +s s:hey.scr" - I have no idea what that does. Need to read up on it.
    When I say I'm a ARexx noob - I mean it. This is literally my first ARexx program ever.


    --- NiKom v2.3.1
    * Origin: Delta City (deltacity.se, Vallentuna, Sweden) (2:201/120.0)
  • From Joacim Melin@2:201/120 to mark lewis on Tue Jan 9 08:00:57 2018
    Great feedback Mark - Thanks!


    --- NiKom v2.3.1
    * Origin: Delta City (deltacity.se, Vallentuna, Sweden) (2:201/120.0)