1, c语言的脚本,推荐.
介绍
This page presents a little program that will help you processing form data in a CGI shell script. If you're unfamiliar with Perl and don't want to write a bulky C program just for a small CGI job, shell script CGI programming may be an option. You receive the form values straight into your shell environment (the names prefixed with "FORM_"), where you can then access them just like other shell variables. (在参数名前加上"FORM_"的前缀)
安装
在Linux下可以用: gcc -o proccgi proccgi.c,这样就生成了一个proccgi的文件。
用法
在Cgi脚本的开头加上一句:
eval "`proccgi $*`" #proccgi最好用全路径
下载
Once again, here's a link to download proccgi.c.
原文: http://www.fpx.de/fp/Software/ProcCGI.html
2, shell语言的脚本,在没有C语言的环境下
用法
eval `proccgi.sh $*` #在不可执行的情况,用`sh proccgi.sh $*` ,proccgi.sh 用全路径
下载
Don't forget to download the code, proccgi.sh.
原文:http://www.fpx.de/fp/Software/ProcCGIsh.html
Example
This is a very simple example of an automatic software-by-email program. You can fill in your email address and a file name which is then automatically mailed to you. Do not, I repeat, do not install this piece of code. It would be a major security leak.
The Form
<form action="http://our-server/cgi-stuff/mailer" method="post"> <dl> <dt> Your Email <dd> <input name="email" size="50"> <dt> Filename <dd> <input name="file" size="50"> </dl> <input type="submit" value="Submit"> </form>
The Script
#!/bin/sh eval `proccgi.sh $*` mail $FORM_email < $FORM_file cat - << \END echo Content-type: text/plain echo echo done. END
有点相关的文章
- IBM文章:Shell、Shell 脚本编写、命令行、相关工具及技巧 (1.000)
- AWK详细参考(转载整理) (0.567)
- 使用linux中的sed编辑器 (0.567)
- Linux:FTP全部命令 使用方法介绍 (0.567)
- linux:md5sum命令 (0.567)
- Bioperl:使用和解析 BLAST (RANDOM - 0.500)







终于等到更新了,写的很给力.......
[回复]
博主说得很对很同意博主的观点.
[回复]