Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Unstoppable

  1. #1
    Senior Member
    Join Date
    Nov 2003
    Location
    Copenhagen, Denmark
    Posts
    163

    Unstoppable

    Is it possible to write a script, that works with an "out-of-the-box" Knoppix 3.3 harddisk installation, that executes a program. Once the program is closed, the scripts restarts the program.
    Can this script be made?

  2. #2
    Senior Member
    Join Date
    Nov 2003
    Location
    Copenhagen, Denmark
    Posts
    163

    PS

    PS: I'm not lazy. I just don't know what scripting language to use. Please initiate me

  3. #3
    Junior Member registered user
    Join Date
    Dec 2003
    Posts
    27
    Simple, use c++
    "
    #include <iostream>

    using name space std;

    void main()
    {
    system("your program path goes here");
    main();
    }
    "

    this will run your program, after that quits it will run the main function and that will run the program and so on for ever.

  4. #4
    Senior Member
    Join Date
    Nov 2003
    Location
    Copenhagen, Denmark
    Posts
    163

    Wow!

    So all I do is create a text file, insert the code, and chmod it executable? Please don't smirk, I'm a newbie.

  5. #5
    Junior Member
    Join Date
    Dec 2003
    Location
    US
    Posts
    3
    Since it's C++, you'll need to compile it first. Put it in a file called forever.cpp and run "g++ forever.cpp -o forever", and you will have an executable called "forever". Careful though - the "#include" line should read "#include <iostream>" (your web browser may think <iostream> is HTML). Oh, and no space between "name" and "space" in "namespace".

    If you want to avoid C++, you can use the following bash script:

    Code:
    #!/bin/bash
    
    function doStuff {
        # your code or program call goes here
        doStuff
    }
    
    doStuff
    Type "man bash" in your shell to learn more about bash.

  6. #6
    Senior Member
    Join Date
    Nov 2003
    Location
    Copenhagen, Denmark
    Posts
    163

    TY

    Thank you all. I feel like a masochist because I hate ignorance

  7. #7
    Senior Member
    Join Date
    Nov 2003
    Location
    Copenhagen, Denmark
    Posts
    163

    OMG

    Oh my, Bash resembles a mixture of Windows batch files and PHP. Smooth

  8. #8
    Senior Member registered user
    Join Date
    Mar 2003
    Posts
    555
    Erhm, sorry but neither of the proposed solutions seem to match the original
    requirement, which implies looping. C++ sure is overkill here, a simple shell
    (bash) script will do:
    Code:
    while true
    do
         # your program invocation here
    done

  9. #9
    Junior Member registered user
    Join Date
    Nov 2003
    Location
    Ottawa, Canada
    Posts
    25
    With that C++ program, I think it would generate a stack overflow error eventually since it's a recursive function. Possibly the first bash script, too (although I don't know enough about bash to tell you either way).

    I'm curious to what program you plan on running.

    You don't want it to run to the exclusion of all other programs, like a kiosk, do you?

  10. #10
    Senior Member
    Join Date
    Nov 2003
    Location
    Copenhagen, Denmark
    Posts
    163

    Kiosk

    I'm very interested in an easy way to set up a kiosk. The program I wish to run recursively is rdesktop. It has to be recursive because logging out of Windows also quits rdesktop.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


RAMAXEL Lenovo 32GB LPDDR5X CAMM2 7500MHz Laptop RAM | UNTESTED picture

RAMAXEL Lenovo 32GB LPDDR5X CAMM2 7500MHz Laptop RAM | UNTESTED

$445.00



NEW Kingston 8GB DDR4 2666MHz Desktop RAM KCP426NS8/8 PC4-21300 picture

NEW Kingston 8GB DDR4 2666MHz Desktop RAM KCP426NS8/8 PC4-21300

$26.00



Crucial DDR3L 16GB 2 x 8GB 1600 MHz PC3L-12800 Laptop RAM Sodimm Memory 1.35V picture

Crucial DDR3L 16GB 2 x 8GB 1600 MHz PC3L-12800 Laptop RAM Sodimm Memory 1.35V

$41.00



16gb ddr5 4800mhz Sodimm Laptop ram Sk Hinyx & Kingston picture

16gb ddr5 4800mhz Sodimm Laptop ram Sk Hinyx & Kingston

$149.00



A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G picture

A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G

$21.68



LOT of 23 16GB DDR4-2666 PC4-21300 Desktop RAM Samsung Crucial UDIMM 368GB Total picture

LOT of 23 16GB DDR4-2666 PC4-21300 Desktop RAM Samsung Crucial UDIMM 368GB Total

$1726.00



Corsair Vengeance RGB Pro 32GB (2x16GB) RAM DDR4 3200MHz CMW32GX4M2C3200C16 picture

Corsair Vengeance RGB Pro 32GB (2x16GB) RAM DDR4 3200MHz CMW32GX4M2C3200C16

$169.99



Major Brand 16GB (2x8GB) PC3-12800U DDR3-1600MHz DDR3-12800 DESKTOP RAM NON-ECC picture

Major Brand 16GB (2x8GB) PC3-12800U DDR3-1600MHz DDR3-12800 DESKTOP RAM NON-ECC

$29.99



Samsung 16GB DDR4 2666MHz PC4-21300 SODIMM RAM M471A2K43CB1-CTD Tested Working picture

Samsung 16GB DDR4 2666MHz PC4-21300 SODIMM RAM M471A2K43CB1-CTD Tested Working

$70.99



sk hynix 32gb ddr4 2933 picture

sk hynix 32gb ddr4 2933

$200.00