Re: dependency check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/22/2011 06:56 PM, Alex Nikitin wrote:
> 
> 
> Or you could just grep the directory, not saying you have to do this,
> but this was kind of fun to write anyways, if i spent more time on it, i
> could perfect it, but i dont have that kind of time, so this will still
> give you a few doubles, but it shouldn't give you false-positives as
> long as you have all the extensions in that grep regex (and you cant
> make it more generic without introducing false-positives)...
> 
> grep -oiPR "[a-zA-Z0-9]+\.(php|js|png|
> jpg|css|htm|html)" directory | awk 'function getfiles(input, files, i,
> n, file) {result = ""; n=split(input, files, ":"); for(i=0; i<=n; i++) {
> if(files[i] !~ /^\s*$/) print files[i];}} {getfiles($0)}' | sort -biu
> 
> This should give you all the files that reference files and the files
> they reference.
> 
> --
> The trouble with programmers is that you can never tell what a
> programmer is doing until it’s too late.  ~Seymour Cray
> 

It is possible to use the shell tools, but it is a big trouble to handle
spaces and special characters in shell scripting if your filenames have
them, quite rare with self created applications, but you can't say, and
hence I suggested python/php script method.

-- 
Regards,
Nilesh Govindarajan
@nileshgr on twitter/identica

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux