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.

USB 3.0 Flash Drive 32GB 64GB 128GB Memory Stick Thumb Stick Lot Pack
$826.09
Critical BIOS ROM HPE ProLiant DL160 DL180 Gen9 (U20) U20_3.40_08_29_2024+iLO4
$7.99
Critical BIOS ROM HPE ProLiant BL460cWS46 Gen9 (I36) I36_3.40_08_29_2024+iLO4
$7.99
Critical BIOS ROM HPE ProLiant DL560 Gen9 (P85) P85_3.40_08_29_2024+iLO4
$7.99
Microsoft Windows 11 Pro 64-Bit USB Flash Drive Sealed with Product Key Card
$39.99
1/ 10/ 100pcs USB 2.0 2GB, 4GB ,8GB ,16GB ,32GB ,64GB 128GB USB Flash Drives Lot
$269.10
Microsoft Windows 11 Pro 64bit - New Sealed – Flash USB 1 PC
$49.99
NEW Samsung USB Type-C 256GB Flash Drive USB 3.2 Gen 1 Genuine OEM -MUF-256DA/AM
$55.99
Microsoft Windows 11 Pro 64-Bit Drive Sealed with Product Key
$34.99
Zero Trace Pen: All-in-one Tor Network Anonymous Drive + Cryptocurrency Wallet
$147.00