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.

Yealink T48S VoIP/SIP Phone, 2 x Gigabit Ports PoE 7" Color SIP-T48S | TESTED
$34.95
Lot of 4 USED IPitomy IP620-B with IPX-32 DSS Expansion Module VoIP Phone POE
$225.00
Grandstream VoIP Phone Adapter ATA 1-Line Black Ethernet (RJ-45) Micro USB
$27.07
Poly CCX 400 Desktop Business Media Phone VoIP 2200-49700-019
$49.99
Yealink SIP-T33G IP Phone 4-LineSpeakerphone VoIP Desk Phone Black w/ Power Sply
$25.00
Grandstream HT701 1-Port FXS Analog Telephone Adapter ATA VoIP Gateway -Free S/H
$19.99
Lot of 4 Cisco CP-8841-3PW-NA-K9 8841 MPP Multiplatform VoIP IP Phone NEW
$450.00
Grandstream WP810 Portable Cordless Wi-Fi IP Phone
$49.28
Verizon Yealink SIP-T46S T46S IP Desk Phone Bluetooth Ready (Open Box)
$74.99
Cisco VoIP Phone CP-8851 with 8800 Key Expansion Modules
$69.00