Shell programming
I'm trying to write a pure-bash random image script. (thttpd is working perfectly, i'm not installing perl/php and apache for one script) I've got the actual random-numbering working fine (in a seperate script), I can get the value it returns, but how do I make the main script take that number and return a filename depending on which one it is? I'm thinking that I should do something like:
BTW, don't tell me to just install Apache and PHP, i don't have space (225mb /) nor do I need all that for something as low-demand as my server. Sure, the script will select a random avatar, but PHP would be overdoing it if I was to install it just for one simple script.
if [ $? = 1 ]; then return "1.png"; fibut I can't return a non-numerical value. How do I return a filename?
BTW, don't tell me to just install Apache and PHP, i don't have space (225mb /) nor do I need all that for something as low-demand as my server. Sure, the script will select a random avatar, but PHP would be overdoing it if I was to install it just for one simple script.
Comments
avatar.png:
random.sh:
and pic.sh:
Should I send the content type before random.sh and pic.sh? Also, since I copied those in, I've since modified pic.sh.
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
I was right, time to fix thttpd...