Forums » Linux
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>
<a href="http://www.forkandspoonsw.com/cgi-bin/dev/code.pl">http://www.forkandspoonsw.com/cgi-bin/dev/code.pl</a>
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.
Uh, yes. That's what I was asking about, the CGI stuff. Haha, did you think that I thought that script was complicated?
-rc
-rc
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 :)
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 :)
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.
#!/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.