PS: I'm not lazy. I just don't know what scripting language to use. Please initiate me![]()
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?
PS: I'm not lazy. I just don't know what scripting language to use. Please initiate me![]()
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.
So all I do is create a text file, insert the code, and chmod it executable? Please don't smirk, I'm a newbie.
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:
Type "man bash" in your shell to learn more about bash.Code:#!/bin/bash function doStuff { # your code or program call goes here doStuff } doStuff
Thank you all. I feel like a masochist because I hate ignorance![]()
Oh my, Bash resembles a mixture of Windows batch files and PHP. Smooth![]()
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
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?
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.

Intel Xeon E5-2680 V2 2.8GHz 10-Core 25MB 8GT/s SR1A6 LGA2011 B Grade Server CPU
$7.95
Dell EMC PowerEdge R440 Xeon silver 4215 2.5GHz 16 GB ram 2x 550W PSU No HDD
$275.00
NEW HP Z4 G4 Workstation Xeon W-2123 16GB ECC 256GB NVMe NVIDIA T400 750W Win11
$450.00
Dell PowerEdge FX2s + 8x FC430 Blades 16x E5-2630v4 160 Cores Rails No PSU/RAM
$699.00
INTEL Xeon E5-2697 V4 SR2JV 2.30GHZ 45MB 18-Core LGA2011-3 CPU P*km
$18.99
HP Z840 44 Core Workstation 2x Xeon E5-2699 v4 - No RAM/ GPU/ HDD/ OS
$594.97
Intel Xeon E5-2699 V4 2.20GHz 55M 22-CORES LGA2011-3 Server Processor 145W SR2JS
$84.49
Dell T7910 Workstation Tower Homelab AI Server PC - Xeon CPU - NO HDD/RAM/GPU
$279.99
Lenovo ThinkServer TS460 Part Number: 70TS-S01U00
$279.00
Dell Precision T7600 MT 2x Intel Xeon E5-2609 2.4GHz 32GB RAM No HDD/OS/GPU
$269.99