NYCPHP Meetup

NYPHP.org

[nycphp-talk] php-perl users, how can I know that?

Ajai Khattri ajai at bitblit.net
Fri Aug 11 11:45:40 EDT 2006


Daniela Gutierrez wrote:
> Hi everybody! I need to get some information out of a web server that is 
> running Debian sarge with php, perl etc. What I need to know is how many 
> users (developers) on the web server are using php on their scripts and 
> how many are using perl. Is there any way to do it easy and fast? If you 
> have any tips on how I can do this I would appreciate it ;)

To find all PHP scripts under /home (assuming they all use .php as the 
filename extension):


# find /home -name "*.php"


Perl might be a bit trickier - some people might be using .pl or .cgi. 
If all your users have a separate cgi-bin folder then it should be easy 
to write a script to iterate through all the cgi-bins and run a find 
command on each:

find /home/$username/cgi-bin -exec grep -l /usr/bin/perl {} \;

(assuming they have something like "#!/usr/bin/perl" at the top of their 
CGI scripts.


There's many ways to skin this cat.

-- 
A



More information about the talk mailing list