本文共 632 字,大约阅读时间需要 2 分钟。
This tutorial looks good,但有点简短.
我安装了apache.如果你不这样做:sudo apt-get install apache2.
cd /usr/lib/cgi-bin
# Make a file and let everyone execute it
sudo touch test.sh && chmod a+x test.sh
然后将一些代码放在文件中.例如:
#!/bin/bash
# get today's date
OUTPUT="$(date)"
# You must add following two lines before
# outputting data to the web browser from shell
# script
echo "Content-type: text/html"
echo ""
echo "
Demo"echo "Today is $OUTPUT
"echo "Current directory is $(pwd)
"echo "Shell Script name is $0"
echo ""
如果一切顺利(就像它对我而言)你应该看到……
Today is Sun Dec 4 …
Current directory is /usr/lib/cgi-bin Shell
Shell Script name is /usr/lib/cgi-bin/test.sh
转载地址:http://wuyhp.baihongyu.com/