dotpupsh - sample dotpup.sh file
Here is an example.
Save it as /root/test/testscript
#!/bin/bash
echo enter something and press \"enter\"
read keypress
xmessage -center you entered $keypress
Now you need a second "starter".
Save it as /root/test/run-testscript
#!/bin/bash
#----- we use an absolute path,
#----- so you can drag the starter to your desktop
myscript=/root/test/testscript
#----- rxvt is closed automatically after execution
rxvt -e $myscript
#----- this needs the "real-Xterm" -Dotpup,
#----- it leaves xterm visible after execution
#xterm -hold -e $myscript
-e means "execute", so rxvt executes your first script.
After execution, your rxvt closes autoatically.
This is not always wanted.
So you could install the "real" xterm.
In Puppy, xterm is just a symlink to rxvt by default.
You also can combine the 2 scripts above to one:
script: allinone-testscript
#!/bin/bash
if [ "$1" != "rxvt" ];then
rxvt -e $0 rxvt &
exit 0
fi
echo enter something and press \"enter\"
read keypress
xmessage -center you entered $keypress
This simply checks, if the script is run with a parameter "rxvt".
This is not the case, when it is clicked in ROX.
In this case, it runs rxvt with itself (and the additional parameter), and exits.
Advantages: no absolute Path needed, shorter.
The "real" xterm supports the parameter "-hold", that avoids, that the window is closed after execution.
Here is a Dotpup with the "real" xterm: http://dotpups.de/dotpups/XServer/xterm.pup∞ (313 kb) http://www.halley.cc/ed/linux/newcomer/shebang.html∞ The Whole Shebang, or What's in a Script
A shell script is merely a list of commands to be executed in the proper order by a shell environment like bash. A shell script can do anything that you could type manually. Conversely, you could type anything that a shell script contained, to do the same tasks manually.
There are many shell script interpreters, and some that are not even intended for use as an interactive command prompting space for users to type their commands. For example, Perl scripts may start with a shebang line similar to #!/usr/local/bin/perl. They're still interpreted by that process and any code within is executed on behalf of the user who invoked the command.
Also, note that the filename has nothing to do with the type of shell required for running the script. The script could have been called sample, or sample.pl or even kernel.exe. In Unix and Linux, it is the contents (such as its shebang), and not the name, which determines how the system will go about executing or opening the file. Many of the commands you run in Linux are just shell scripts that have no filename extensions.
Some helpful manual pages on your Linux system may be (help source), (man bash), (man chmod), and (man perl).
Some helpful google searches may be linux shell commands scripts, linux shebang notation, linux bash PATH variable, linux file mode permissions, and common scripting languages.