Forums » Linux

fancy new tga>jpg converter

«12
Mar 20, 2004 red cactus link
Oh come on. I'm not going to tell you. I'll even make it a link, so you don't have to copy and paste:
<a href="http://www.forkandspoonsw.com/cgi-bin/dev/code.pl">http://www.forkandspoonsw.com/cgi-bin/dev/code.pl</a>
Mar 20, 2004 roguelazer link
So it just takes an input and says "YOU'RE AN IDIOT", regardless of the input? That could be easily done in bash. However, I don't know much about the cgi parsing routines. So I'd need to actually look up how to get the submit input and check that it's not null.
Mar 20, 2004 red cactus link
Uh, yes. That's what I was asking about, the CGI stuff. Haha, did you think that I thought that script was complicated?

-rc
Mar 22, 2004 cosurgi link
oh, I often convert bmp to ppm (to make animations) and I always do sth like that:

for m in *.bmp; do convert -modulate 93,186 -crop 256x432+27+456 $m ppm:`basename $m .bmp`.ppm; rm $m; done


see. one line only :)
May 03, 2004 Nighty link
Proof of concept bash script that accomplishes the same as the perl script:

#!/bin/bash
read line
val=`echo $line | cut -d= -f2`
if [ -z "$val" ] ; then
echo "Content-type: text/html"
echo
echo "<html><head><title>Enter code!</title></head>"
echo "<body>"
echo "<form action=test.cgi method=post>"
echo "<input name=\"input\" type=text>"
echo "<input type=submit value=Submit>"
echo "</form>"
echo "</body></html>"
echo
else
~/input
fi


As you can see, it's possible in bash as well, but I prefer perl over bash nonetheless (bash is a bitch, and the manpages suck).

Oh yeah, you can test it at http://nighty.studentenweb.org/test.cgi

Then again, I prefer php over any cgi anytime.