
[flycat@redhat script]$ sh -x aaa.sh
+ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/home/flycat/bin
+ export PATH
+ echo 'Input your selection'
Input your selection
+ case $1 in
+ echo 'Usage {one|two|three}'
Usage {one|two|three}
[flycat@redhat script]$ chmod 755 aaa.sh
[flycat@redhat script]$ ./aaa.sh
Input your selection
Usage {one|two|three}
[flycat@redhat script]$ ./aaa.sh one
Input your selection
Your choice is ONE
[flycat@redhat script]$ ./aaa.sh two
Input your selection
Your choice is TWO
[flycat@redhat script]$ ./aaa.sh three
Input your selection
Your choice is THREE
command 2&>/dev/null #就不显示错误command 1&>/dev/null 2&>/dev/null #取消所有输出
其中command是要调用的脚本,其后的内容不算作参数,被shell直接解析如果改成
command 2&>file就会将错误重定向到file文件
首先查看日志信息,比如 less /var/log/apache2/error.log找到出错的地方,其次,就你的问题,可能没有添加对perl脚本的支持,对perl脚本或者cgi的目录确保有下面的支持语句:# directory to store data for web browser viewing
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
<Directory /var/www/cgi>
Options FollowSymLinks ExecCGI
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)