Home > Archive > PERL CGI Beginners > April 2005 > grep pattern problem
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
grep pattern problem
|
|
| TapasranjanMohapatra 2005-04-25, 3:55 pm |
| All,
I am trying to print the output of grep command through cgi.
When I do grep on a specific file I get the desired output, but while I =
try something like
" grep -Ri pattern ../directoryname/ "
I get no output when I run cgi(browser) though I get the output =
correctly run in commandline (perl).
The directory and files have all permissions (777) recursively.
I see the same problem when I do "grep pattern ../directory/* " also.
Can someone tell me what may be the problem.
TIA
tapas
| |
| Ing. Branislav Gerzo 2005-04-26, 3:55 pm |
| TapasranjanMohapatra [T], on Monday, April 25, 2005 at 17:51 (+0530)
wrote:
T> The directory and files have all permissions (777) recursively.
T> I see the same problem when I do "grep pattern ../directory/* " also.
T> Can someone tell me what may be the problem.
maybe your path is not well set up. What you get, if you run dir(ls) ?
--
How do you protect mail on web? I use http://www.2pu.net
[AC/DC is a sort-of sophisticated neanderthal stomp.]
| |
| TapasranjanMohapatra 2005-04-27, 8:55 am |
|
-----Original Message-----
From: Ing. Branislav Gerzo [mailto:konfera@2ge.us]
Sent: Tue 4/26/2005 8:51 PM
To: beginners-cgi@perl.org
Subject: Re: grep pattern problem
=20
TapasranjanMohapatra [T], on Monday, April 25, 2005 at 17:51 (+0530)
wrote:
T> The directory and files have all permissions (777) recursively.
T> I see the same problem when I do "grep pattern ../directory/* " also.
T> Can someone tell me what may be the problem.
maybe your path is not well set up. What you get, if you run dir(ls) ?
----
How do I set the path for CGI? If I do a print on $ENV{'PATH'},=20
I get /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
And 'ls' and 'dir' are in /usr/bin. Still I get nothing when I run dir =
or ls.
I tried with absolute path. Still I am not getting any output.
Would you let me know how should I go about solving the problem.
Thanks for your help.
Tapas
--
How do you protect mail on web? I use http://www.2pu.net
[AC/DC is a sort-of sophisticated neanderthal stomp.]
--=20
To unsubscribe, e-mail: beginners-cgi-unsubscribe@perl.org
For additional commands, e-mail: beginners-cgi-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>
| |
| Ing. Branislav Gerzo 2005-04-27, 8:55 am |
| TapasranjanMohapatra [T], on Wednesday, April 27, 2005 at 11:33
(+0530) has on mind:
T> How do I set the path for CGI? If I do a print on $ENV{'PATH'},
T> I get /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
that's ok.
#!/usr/bin/perl
$| = 1; #always use this
print "Content-type: text/html\n\n";
system("ls");
__END__
what about this ?
--
How do you protect mail on web? I use http://www.2pu.net
[I never believe anything until it's been officially denied.]
|
|
|
|
|