Finding All Pro *C executables


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Finding All Pro *C executables
# 1  
Old 10-20-2014
Finding All Pro *C executables

Hi ,
I want to find all Pro *C executables in a directory say /.

When i fire file command on Pro*c file it gives below o/p

ELF-64 executable object file - PA-RISC 2.0 (LP64)

my system is HP-UX eux012 B.11.23 U 9000/800 151107499 unlimited-user license

but when i fire file on a C executable it gives same kind of O/P

/bin/ls: PA-RISC1.1 shared executable dynamically linked -not stripped dynamically linked

is there a way of uniquely identifying all Pro *C executables i.e. grep soem O/P of file command

Thanks
# 2  
Old 10-20-2014
Try the strings command, the SQL in there is stored as nul-terminated strings.

Code:
find /path -type f |
while read fname
do
    strings $fname | egrep -iq '(select|delete|insert|update)' && echo $fname
done

This is not completely goof proof. It can return a false positive.

A better choice is to use ldd:

Code:
find /path -type f |
while read fname
do
    ldd $fname | grep -q 'libclntsh' && echo $fname
done

Anything linked for Pro*C has to have that library.
# 3  
Old 10-20-2014
I used both ,
fo 1st one i couldnt grep any select etc commands in strings O/P

my O/P is

Code:
 
strings  PB2bTx_001
@(#) fml/libfml/fml32.h $Revision: 1.14 $
@(#) tuxedo/include/atmi.h      $Revision: 1.29 $
@(#) gp/libgp/mach/hpux_ev.h    $Revision: 1.12 $
@(#) fml/libfml/fml32.h $Revision: 1.14 $
@(#) tuxedo/include/atmi.h      $Revision: 1.29 $
@(#) gp/libgp/mach/hpux_ev.h    $Revision: 1.12 $
PB2bTs_ObjXEnt.pc
@(#) fml/libfml/fml32.h $Revision: 1.14 $
@(#) tuxedo/include/atmi.h      $Revision: 1.29 $
@(#) gp/libgp/mach/hpux_ev.h    $Revision: 1.12 $
//home/rahats/tuxtechlit/sql/FuncRNHistorySQL.pc
@(#) fml/libfml/fml32.h $Revision: 1.14 $
@(#) tuxedo/include/atmi.h      $Revision: 1.29 $
@(#) gp/libgp/mach/hpux_ev.h    $Revision: 1.12 $
)/home/rahats/tuxtechlit/sql/FuncRPOSQL.pc

for second one, i got below for ldd O/P

Code:
 
epq012{root}# ldd PB2bTx_001
PB2bTx_001:
        Unable to find library 'tuxliboraxa.sl'.

this doesnt seem to work
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Ubuntu

Gcc cannot create executables

https://www.unix.com/302461112-post1.html Thank you. It's still in Linux Mint 17 (3 Replies)
Discussion started by: jgt
3 Replies

2. Shell Programming and Scripting

Scripting with executables

Hi everyone, I am working with an executable (let's say work) in bash shell. When I run this work executable it asks the following information; 1- choose task a or b 2- input file 3- output file 4- some operational choices after it reads the given input file, does some algebraic... (17 Replies)
Discussion started by: hayreter
17 Replies

3. Shell Programming and Scripting

Makefile with multiple executables

CROSS_COMPILE?= LIBDIR_APP_LOADER?=../../../../app_loader/lib INCDIR_APP_LOADER?=../../../../app_loader/include BINDIR?=../../bin CFLAGS+= -Wall -I$(INCDIR_APP_LOADER) -D__DEBUG -O2 -mtune=cortex-a8 -march=armv7-a -std=gnu99 LDFLAGS+=-L$(LIBDIR_APP_LOADER) -lprussdrv -lpthread OBJDIR=obj... (1 Reply)
Discussion started by: bpetersen
1 Replies

4. Shell Programming and Scripting

Help: Makefile with multiple executables

I am trying to create executables for the following files Currently, I am making 9 different directories for for each. I would like to make 1 directory but everytime I try it does not work. CROSS_COMPILE?= # CROSS_COMPILE used to = arm-arago-linux-gnueabi... (1 Reply)
Discussion started by: bpetersen
1 Replies

5. Shell Programming and Scripting

Searching for executables

Hello Unix users, this is my first post here. :) I want to search a directory (and subdirectories) for executable files (files with rwx------ permission) and move them to a different folder. What Unix commands can accomplish this? (2 Replies)
Discussion started by: Sagan_Radiation
2 Replies

6. Programming

Compare two executables

Hi - I have two complex (for me at least) make files. The older one creates a succesful executable. The later one uses if statements to conditionally make different versions of the executable. The 2nd produces an executable that fails. I have "eyeballed" the differences in the Make files and run... (18 Replies)
Discussion started by: BrighterLater
18 Replies

7. Programming

executables ending with *

Hi All, I m very new to unix. I have a basic doubt .. In unix I m seeing that there is a * at the end of by executable name (exe1*).. Wht is the significance of that Thanks a lot in advance (2 Replies)
Discussion started by: binums
2 Replies

8. UNIX for Dummies Questions & Answers

cannot create executables

I am trying to install PROFTPD-1.2.7 on a SCO OpenServer 5.0.6 Server with a gcc-2.95.2 installed the VOLS files from http://www.caldera.com/skunkware. The problem I am having is when I try to run ./configure in the proftpd directory I get this error: # ./configure checking build system... (6 Replies)
Discussion started by: stufine
6 Replies

9. UNIX for Dummies Questions & Answers

domain logon problem - FreeBSD PDC w/ win2k pro and winxp pro

this is the seventh problem i'm having with samba. for some reason, i cannot logon to the domain. i've created user accounts... and i was able to establish a connection between the samba server (my PDC) and my workstations by logging in as "root." however now when i try to logon it gives... (5 Replies)
Discussion started by: xyyz
5 Replies

10. UNIX for Dummies Questions & Answers

cksum all executables on drive

I know I can run the cksum command for multiple files in a directory and send the results to a new file. EX.) # cd /usr # cksum *_ex* > /tmp/cksumusr.txt But I can't figure out how to run this command on multiple files in all directories on drive. Is it possible to do this, without having... (2 Replies)
Discussion started by: crazykelso
2 Replies
Login or Register to Ask a Question