这个文件的所属者为root,而/bin/ls这个文件也是所有用户都可以运行的。<br><br>请问还需要哪里设置嘛?<br><br><div class="gmail_quote">2008/6/5  &lt;<a href="mailto:china-pm-request@pm.org">china-pm-request@pm.org</a>&gt;:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Send China-pm mailing list submissions to<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:china-pm@pm.org">china-pm@pm.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="http://mail.pm.org/mailman/listinfo/china-pm" target="_blank">http://mail.pm.org/mailman/listinfo/china-pm</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:china-pm-request@pm.org">china-pm-request@pm.org</a><br>
<br>
You can reach the person managing the list at<br>
 &nbsp; &nbsp; &nbsp; &nbsp;<a href="mailto:china-pm-owner@pm.org">china-pm-owner@pm.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of China-pm digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
 &nbsp; 1. &nbsp;请教perl cgi页面如何显示ls信息 (gary.jsz)<br>
 &nbsp; 2. &nbsp;请教perl cgi页面如何显示ls信息 (gary.jsz)<br>
 &nbsp; 3. Re: &nbsp;请教perl cgi页面如何显示ls信息 (Yisu Dong)<br>
 &nbsp; 4. Re: &nbsp;请教perl cgi页面如何显示ls信息 (truncatei)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Thu, 5 Jun 2008 11:11:09 +0800<br>
From: &quot;gary.jsz&quot; &lt;<a href="mailto:gary.jsz@gmail.com">gary.jsz@gmail.com</a>&gt;<br>
Subject: [PerlChina] 请教perl cgi页面如何显示ls信息<br>
To: &quot;<a href="mailto:china-pm@pm.org">china-pm@pm.org</a>&quot; &lt;<a href="mailto:china-pm@pm.org">china-pm@pm.org</a>&gt;, &quot;<a href="mailto:china-pm@pm.org">china-pm@pm.org</a>&quot;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;<a href="mailto:china-pm@pm.org">china-pm@pm.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:200806051111065626409@gmail.com">200806051111065626409@gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;gb2312&quot;<br>
<br>
&nbsp;我的代码如下:<br>
#!/usr/bin/perl -w<br>
#<br>
use strict;<br>
use utf8;<br>
#use CGI qw/:standard/;<br>
use CGI qw/:all/;<br>
print header,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;start_html(&quot;Mailing list manager system page&quot;),<br>
 &nbsp; &nbsp; &nbsp; &nbsp;h1(&#39;Maillist&amp;#31649;&amp;#29702;&amp;#31995;&amp;#32479; &#39;),<br>
 &nbsp; &nbsp; &nbsp; &nbsp;start_form,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&quot;What are you doing?&quot;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;popup_menu(-name=&gt;&#39;choose&#39;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -values=&gt;[qw(select create delete modify)]),p,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;submit,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;end_form,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;hr;<br>
if(param()){<br>
 &nbsp; &nbsp; &nbsp; &nbsp;if (em(param(&#39;choose&#39;)) =~ /select/){<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;system &quot;date&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print `ls -l \$HOME`;<br>
#system &quot;ls -l \$HOME&quot;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp; &nbsp; &nbsp;if (em(param(&#39;choose&#39;)) =~ /create/){<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;system &quot;date -u&quot;;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
}<br>
<br>
其中时间能正确显示,但是,就是不能打印 ls -l $HOME 这行,换成 system &quot;ls -l \$HOME&quot;也不能打印,还希望各位老师能指教,谢谢!<br>
<br>
<br>
<br>
<br>
Gary.jsz<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://mail.pm.org/pipermail/china-pm/attachments/20080605/c3200526/attachment-0002.html" target="_blank">http://mail.pm.org/pipermail/china-pm/attachments/20080605/c3200526/attachment-0002.html</a><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Thu, 5 Jun 2008 11:11:09 +0800<br>
From: &quot;gary.jsz&quot; &lt;<a href="mailto:gary.jsz@gmail.com">gary.jsz@gmail.com</a>&gt;<br>
Subject: [PerlChina] 请教perl cgi页面如何显示ls信息<br>
To: &quot;<a href="mailto:china-pm@pm.org">china-pm@pm.org</a>&quot; &lt;<a href="mailto:china-pm@pm.org">china-pm@pm.org</a>&gt;, &quot;<a href="mailto:china-pm@pm.org">china-pm@pm.org</a>&quot;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;<a href="mailto:china-pm@pm.org">china-pm@pm.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:200806051111065626409@gmail.com">200806051111065626409@gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;gb2312&quot;<br>
<br>
&nbsp;我的代码如下:<br>
#!/usr/bin/perl -w<br>
#<br>
use strict;<br>
use utf8;<br>
#use CGI qw/:standard/;<br>
use CGI qw/:all/;<br>
print header,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;start_html(&quot;Mailing list manager system page&quot;),<br>
 &nbsp; &nbsp; &nbsp; &nbsp;h1(&#39;Maillist&amp;#31649;&amp;#29702;&amp;#31995;&amp;#32479; &#39;),<br>
 &nbsp; &nbsp; &nbsp; &nbsp;start_form,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&quot;What are you doing?&quot;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;popup_menu(-name=&gt;&#39;choose&#39;,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -values=&gt;[qw(select create delete modify)]),p,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;submit,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;end_form,<br>
 &nbsp; &nbsp; &nbsp; &nbsp;hr;<br>
if(param()){<br>
 &nbsp; &nbsp; &nbsp; &nbsp;if (em(param(&#39;choose&#39;)) =~ /select/){<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;system &quot;date&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;print `ls -l \$HOME`;<br>
#system &quot;ls -l \$HOME&quot;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
 &nbsp; &nbsp; &nbsp; &nbsp;if (em(param(&#39;choose&#39;)) =~ /create/){<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;system &quot;date -u&quot;;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
}<br>
<br>
其中时间能正确显示,但是,就是不能打印 ls -l $HOME 这行,换成 system &quot;ls -l \$HOME&quot;也不能打印,还希望各位老师能指教,谢谢!<br>
<br>
<br>
<br>
<br>
Gary.jsz<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://mail.pm.org/pipermail/china-pm/attachments/20080605/c3200526/attachment-0003.html" target="_blank">http://mail.pm.org/pipermail/china-pm/attachments/20080605/c3200526/attachment-0003.html</a><br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Thu, 5 Jun 2008 11:20:16 +0800<br>
From: &quot;Yisu Dong&quot; &lt;<a href="mailto:ximiff@gmail.com">ximiff@gmail.com</a>&gt;<br>
Subject: Re: [PerlChina] 请教perl cgi页面如何显示ls信息<br>
To: <a href="mailto:china-pm@pm.org">china-pm@pm.org</a><br>
Message-ID:<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;<a href="mailto:b3a8e37e0806042020w744d564bp4cfb66eb1edab008@mail.gmail.com">b3a8e37e0806042020w744d564bp4cfb66eb1edab008@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;gb2312&quot;<br>
<br>
我的没有问题。可以打印<br>
<br>
2008/6/5 gary.jsz &lt;<a href="mailto:gary.jsz@gmail.com">gary.jsz@gmail.com</a>&gt;:<br>
<br>
&gt; &nbsp; 我的代码如下:<br>
&gt; &nbsp;#!/usr/bin/perl -w<br>
&gt; #<br>
&gt; &nbsp;use strict;<br>
&gt; use utf8;<br>
&gt; &nbsp;#use CGI qw/:standard/;<br>
&gt; use CGI qw/:all/;<br>
&gt; &nbsp;print header,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; start_html(&quot;Mailing list manager system page&quot;),<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; h1(&#39;Maillist&amp;#31649;&amp;#29702;&amp;#31995;&amp;#32479; &#39;),<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; start_form,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &quot;What are you doing?&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; popup_menu(-name=&gt;&#39;choose&#39;,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-values=&gt;[qw(select create delete modify)]),p,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; submit,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; end_form,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; hr;<br>
&gt; &nbsp;if(param()){<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; if (em(param(&#39;choose&#39;)) =~ /select/){<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; system &quot;date&quot;;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print `ls -l \$HOME`;<br>
&gt; #system &quot;ls -l \$HOME&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; if (em(param(&#39;choose&#39;)) =~ /create/){<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; system &quot;date -u&quot;;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt; &nbsp;}<br>
&gt;<br>
&gt; 其中时间能正确显示,但是,就是不能打印 ls -l $HOME 这行,换成 system &quot;ls -l<br>
&gt; \$HOME&quot;也不能打印,还希望各位老师能指教,谢谢!<br>
&gt;<br>
&gt; ------------------------------<br>
&gt; &nbsp; Gary.jsz<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; China-pm mailing list<br>
&gt; <a href="mailto:China-pm@pm.org">China-pm@pm.org</a><br>
&gt; <a href="http://mail.pm.org/mailman/listinfo/china-pm" target="_blank">http://mail.pm.org/mailman/listinfo/china-pm</a><br>
&gt;<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://mail.pm.org/pipermail/china-pm/attachments/20080605/a285188b/attachment-0001.html" target="_blank">http://mail.pm.org/pipermail/china-pm/attachments/20080605/a285188b/attachment-0001.html</a><br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Thu, 5 Jun 2008 11:40:08 +0800<br>
From: truncatei &lt;<a href="mailto:truncatei@gmail.com">truncatei@gmail.com</a>&gt;<br>
Subject: Re: [PerlChina] 请教perl cgi页面如何显示ls信息<br>
To: <a href="mailto:china-pm@pm.org">china-pm@pm.org</a><br>
Message-ID:<br>
 &nbsp; &nbsp; &nbsp; &nbsp;&lt;<a href="mailto:c0d775f40806042040g76f87854re4669cde449a3180@mail.gmail.com">c0d775f40806042040g76f87854re4669cde449a3180@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
看下运行这个CGI的用户身份,Apache一般运行在不同的用户帐号下<br>
<br>
2008/6/5 gary.jsz &lt;<a href="mailto:gary.jsz@gmail.com">gary.jsz@gmail.com</a>&gt;:<br>
&gt; &nbsp;我的代码如下:<br>
&gt; #!/usr/bin/perl -w<br>
&gt; #<br>
&gt; use strict;<br>
&gt; use utf8;<br>
&gt; #use CGI qw/:standard/;<br>
&gt; use CGI qw/:all/;<br>
&gt; print header,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; start_html(&quot;Mailing list manager system page&quot;),<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; h1(&#39;Maillist&amp;#31649;&amp;#29702;&amp;#31995;&amp;#32479; &#39;),<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; start_form,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &quot;What are you doing?&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; popup_menu(-name=&gt;&#39;choose&#39;,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-values=&gt;[qw(select create delete modify)]),p,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; submit,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; end_form,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; hr;<br>
&gt; if(param()){<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; if (em(param(&#39;choose&#39;)) =~ /select/){<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; system &quot;date&quot;;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print `ls -l \$HOME`;<br>
&gt; #system &quot;ls -l \$HOME&quot;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; if (em(param(&#39;choose&#39;)) =~ /create/){<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; system &quot;date -u&quot;;<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt; }<br>
&gt;<br>
&gt; 其中时间能正确显示,但是,就是不能打印 ls -l $HOME 这行,换成 system &quot;ls -l<br>
&gt; \$HOME&quot;也不能打印,还希望各位老师能指教,谢谢!<br>
&gt;<br>
&gt; ________________________________<br>
&gt; Gary.jsz<br>
&gt;<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
China-pm mailing list<br>
<a href="mailto:China-pm@pm.org">China-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/china-pm" target="_blank">http://mail.pm.org/mailman/listinfo/china-pm</a><br>
<br>
End of China-pm Digest, Vol 38, Issue 3<br>
***************************************<br>
</blockquote></div><br><br clear="all"><br>-- <br>gary<br><a href="mailto:gary.jsz@gmail.com">gary.jsz@gmail.com</a>