-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Aug 18, 2003 at 05:23:47AM -0700, MALKIAT BENIPAL wrote:

        its a little tricky! I think a little perl scripty might 
        do the job. :)

        ok now we know that file wont work because all it does is print
        ELF bianary for almost everything.

        so we use ldd and try to look for shared libraries most probably 
        a cobol bianary will depend on different shared libraries then a
        c compiled bianary. so here is my tiddly middly perl regex with
        apologies to all perl gurus out there.

- - ---------cut here------
#!/usn/bin/perl 
use warnings;
use strict;

#proggy to find out c & cobol bianaries
#syntax-> $perl proggy.pl /path/to/dir

$main::tmp= shift @ARGV;
my @file = `exec ls $main::tmp`;
foreach(@file)
        {
                my $tmp2=$main::tmp.$_;
                my $tmp1= `exec ldd $tmp2`;
                if ($tmp1=~/libc\.so/sm) #we are looking for a clue
                                         #for c files 
                { 
                        print "C: $_";  
                }
                elsif($tmp1=~/libcobol/sm) #we are grepping for cobol
                                           #    libraries
                {
                        print "Cobol: $_";
                }
        
        }
- - ------cut here-------
        
        unfortunatly, I am not a cobol programmer :( so dont know what
        kind of libraries a cobol bianary depends on. I think my libc.so
        thing for c files is wrong too but I think you get the idea about
        how to do it. anyone with a *brighter* idea????
                

        cheers!
        

- -- 
all the things we keep inside,
are the things that really matter,
the face puts on its best disguise,
and all is well, until the heart betrays.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQE/QQN87v3NbZTFJeIRAoMlAKC23sLDYZs/AY5T7z+TGPSAYetMfQCgtvS/
nZ/jscfDcTSGfHrTNTP+hDo=
=Z/o7
-----END PGP SIGNATURE-----

_______________________________________________
ilugd mailing list
[EMAIL PROTECTED]
http://frodo.hserus.net/mailman/listinfo/ilugd

Reply via email to