shell to find out DBCP ( try - catch ) in java


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting shell to find out DBCP ( try - catch ) in java
# 8  
Old 06-17-2011
basically, the command is NOT gonna print any file, that doesn't containing "
new DataBaseConnection" string. Can that be that the string in your java file as comment? so you think it should be the "correct" case, but listed out by my command?
This User Gave Thanks to sk1418 For This Post:
# 9  
Old 06-17-2011
yes of course.

i am very very happy.

But the thing is it's listing some "un"problematic files also Smilie

Let it be. No problem. I will find all those manually.

Any way my work reduced a lot.

Thanks again.

.

---------- Post updated at 06:30 PM ---------- Previous update was at 05:42 PM ----------

sk1418,

i did it. extracted those files again.

yourCommand > fileOne.txt -->> >1800 files

cp `cat fileOne.txt` | grep -v "new Databaseconnection" > newFile.txt ---> 158files.

again i need to filter..
# 10  
Old 06-17-2011
or you could try grep first, then pass to my awk. (although I thought the printed out file by my awk must contain "new Databaseconnection..." in java codes or java comments). e.g.

Code:
grep -il "new databaseconnection(" | xargs awk ....

can it reduce your effort a little bit?
# 11  
Old 06-17-2011
yes.. thanks.

You rocks..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Cannot find java, gcc, Oracle on RedHat 7.2

We received Linux RedHat. I tried java -versionno result gcc -c no result I cannot even find Oracle version or directory Do you know if JAVA, gcc, Oracle are supposed to come with Linux by default? Thanks, (3 Replies)
Discussion started by: digioleg54
3 Replies

2. Homework & Coursework Questions

Java doesnīt find the CLASSPATH (System variable)

1. The problem statement, all variables and given/known data: As a excercise I have to compile a program (Hello2.java) with a class file (HelloText.java) in another directory. (As you seen in the screenshot) Iīm setting a PATH and a CLASSPATH (system variables). Itīs working without a... (2 Replies)
Discussion started by: MenschTown
2 Replies

3. Shell Programming and Scripting

How to catch errors in a shell script ( multiple commands )?

Hi I have a shell script like that Main() { DAY=$(date +"%d-%m-%Y") TIME=$(date +"%T") Command 1 Command 2 ... Command n } I would like to catch errors from all commands in Main() and write these errors into a file , something likes this: Main if < error > then echo... (3 Replies)
Discussion started by: bobochacha29
3 Replies

4. Shell Programming and Scripting

How to run java from shell

Hi All, I am trying to run a grep command which creates an output file. Then I will run a java file which take that file and process that. My java file uses other java files and library jars. I have tried below code but I am getting compilation error,it can not find other java files in same... (1 Reply)
Discussion started by: kmajumder
1 Replies

5. UNIX for Dummies Questions & Answers

find/xargs/*grep: find multi-line empty "try-catch" blocks - eg, missing ; not in a commented block

How can I recursively find all files in a directory and print out the file and first line number of any text blocks that match the below cases? This would seem to involve find, xargs, *grep, regex, etc. In summary, I want to find so-called empty "try-catch blocks" that do not contain code... (0 Replies)
Discussion started by: lifechamp
0 Replies

6. Shell Programming and Scripting

Shell script to catch PL/SQL return values

I tried searching the forum for similar posts but its closed now. Would appreciate any help on this. I am trying to capture return value from a select query into a variable. DB is Oracle I am able to spool it to a file but I donot intend to use it. Here is my script that does not work ;) I... (27 Replies)
Discussion started by: monie2717
27 Replies

7. Shell Programming and Scripting

Unable to find java command

Hi All, Am trying to start a server by using the startup shell script. But am getting java command not found. Can anyone guide me in which path i need to check for all the java commands and also how do i chk the version of java being installed on linux box? Thanks (3 Replies)
Discussion started by: Ashok_oct22
3 Replies

8. Shell Programming and Scripting

How to catch ENTER key inside the shell script?

Hi, I have a script in which i have to ask user to press the ENTER key to proceed further. can you please help me how can i achive this in my scripting? echo "All the executables builded Successfully " echo " Press Enter to Go Back to the Main Menu" ... (2 Replies)
Discussion started by: plaban.rout
2 Replies

9. Shell Programming and Scripting

Shell script to catch PL/SQL return values

Hello, I need some help from the experts on PL/SQL and Shell scripting. I need a shell script that runs a PL/SQL procedure and gets the values returned from the PL/SQL procedure into the shell variables. The PL/SQL procedure returns multiple values. I was able to assign a single return value... (1 Reply)
Discussion started by: Veera_Raghav
1 Replies

10. Linux

Help req for...shell script to catch "db2 connect" errors ...

Hello friends, Assume that, I am trying to execute a "db2 connect" command from Linux shell prompt via a shell script called "sample" sample db2 connect to bas39 $sample If the database is not present its should display a custom error message by catching the error message given by db2.... (1 Reply)
Discussion started by: frozensmilz
1 Replies
Login or Register to Ask a Question