[PLUG] Tool to identify applications requiring python

Michael Christopher Robinson michael at robinson-west.com
Mon Apr 17 01:55:24 UTC 2017


On Sun, 2017-04-16 at 20:40 -0500, David Fleck wrote:
> On Sun, 2017-04-16 at 15:49 -0700, Rich Shepard wrote:
> >    I was wondering if there's a gnu utility that can query
> > installed
> > executables (in /usr/bin, /bin, /usr/local/bin, etc.) for the
> > string
> > 'python.'
> 
> for i in /usr/bin/*; do strings $i | grep python && echo $i >>
> output.txt
> 
> Replace /usr/bin/* as needed.
 
Could this be faster if you can restrict the scan to ascii text
files???  Use file somehow to decide if a file should be checked or
not?

for i in /usr/bin/*;do file $i | grep 'ascii text'...

I need to store the result of file and whether or not it was ascii text
as well as the name of the file that is ascii text.  Then take file and
do cat file | grep 'python' ; if python then notify caller.

Sorry about the vague mixture of pseudo code and non pseudo code.

   --  Michael C. Robinson



More information about the PLUG mailing list