1833852 Members
1962 Online
110063 Solutions
New Discussion

"findstrings" command

 
SOLVED
Go to solution
Reynaldo Torres
Advisor

"findstrings" command

It used to be a patch or program that will allow you to have the command "findstrings". It's really powerful and I used it in hp-ux 10.20 and 11.00. I do not know or remember how I got it. I kept a copy that I attached in here, but I have omitted a lot of wording. I tried to use it as writing it the way it shows, but every time I used it hungs and it does not give me the results I used to get before,and also was very clean results primarily when you were looking for words, password and any other kind strings. Please if you could help me to review the script why? is hanging,I will really appreciated. Thank you in advance for your support and help.

RT
Reynaldo Torres
7 REPLIES 7
Marco A.
Esteemed Contributor
Solution

Re: "findstrings" command

Hello Reynaldo,

Try this other one, maybe it works...

Just unplug and plug in again ....
Peter Nikitka
Honored Contributor

Re: "findstrings" command

Hi,

I think - without having tested - that the arguments of xargs are messed up.
Try with a header of
#!/usr/bin/sh -x

instead of
#!/bin/sh

and tell us the line of
find .. | xargs

I assume 'xargs -e grep' will use the grep argument for the '-e'-option and not call grep at all.

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
spex
Honored Contributor

Re: "findstrings" command

Hi Reynaldo,

I've modified your script a bit. Please give the attached file a try.

PCS
OldSchool
Honored Contributor

Re: "findstrings" command

"very powerful"?

not really. it's just a front end to "grep"
that attempts to find similar-named "text" files and then process them.

If the "-v" option used to produce something like:
fname: match_result
fname1: match_result

while running w/o "-v" got a list of filenames only, the solution is:

at the top, set "L=-l" (that's a lower case "L"). currently its set to "minus one" which is why you get the argument error from grep.
OldSchool
Honored Contributor

Re: "findstrings" command

hmm...

-v produces a list of matches w/o files

w/o -v you get list of filename w/ matching strings.

OldSchool
Honored Contributor

Re: "findstrings" command

hmm...

-v produces a list of matching strings only(w/o filename)

w/o -v you get list of filenames containg matches



spex
Honored Contributor

Re: "findstrings" command

The '-v' option to the script switches off the '-l' option to grep, which is enabled by default:

...
L="-l"
...
while getopts iv OPT
do
...
v) L= # Verbose
...