Sponsored Content
Top Forums Shell Programming and Scripting Block of code replacement in Java source code through Unix script Post 302593077 by hareeshram on Wednesday 25th of January 2012 02:46:05 PM
Old 01-25-2012
Block of code replacement in Java source code through Unix script

Hi,

I want to remove the following code from Source files (or replace the code with empty.) from all the source files in given directory.
Code:
finally {
			if (null != hibernateSession && hibernateSession.isOpen()) {
				//hibernateSession.close();
			}
		}

It would be great if the script has the following capability.

It should identify
a) finally block and its {
b) after that it should ignore { } combinations until it gets its closing }
for ex: in the above, inside finally , there is an if and it has { and } which are to be ignored.
3) and once it identified whole block, it has to be removed.

Many thanks for your help.

Last edited by Franklin52; 01-26-2012 at 03:42 AM.. Reason: Please use code tags for code and data samples, thank you
 

7 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

the source code of unix

tha ithela na moy peite an mporo apo kapoy na vro ton pigaio kvdika toy unix se glossa c .efxaristo. (1 Reply)
Discussion started by: matsoyka
1 Replies

2. Post Here to Contact Site Administrators and Moderators

Source Code Of Unix

Do you have the source code of UNIX? If yes, can you please send it to me on my email email address deleted For your this help I shall be obliged to you. With Regards rajesh ***phone removed*** (1 Reply)
Discussion started by: rajesh_ranjan26
1 Replies

3. Linux

how to get source code of Unix commands?

Can anyone tell me how/where to get the source code for the unix commands like "ls ,finger,cp....etc" commands . I have tried very hard but failed so far. Thanks JAGDISH MACHHI (4 Replies)
Discussion started by: jagdish.machhi@
4 Replies

4. Programming

Exception Signal 11 while running JAVA code in UNIX

Hi, when i compile my java code in UNIX using javac, the class file is getting created. But when i try to run the code using java - classpath command, i get the following error. ---------------------------------------- /u/up11/sample/request:>java -classpath /u/up11/sample/request... (0 Replies)
Discussion started by: satish2712
0 Replies

5. Programming

I have C++ exe file( no source code) and need to run many large dataset under unix, b

I have C++ exe file( no source code) and need to run many large dataset under unix, but how to know the memeroy usage for one dataset?http://www.codeproject.com/script/Forums/Images/New.gif I think "top" is not good and if using the profiler, it seems no free download, any ideas? (1 Reply)
Discussion started by: Danielwang1986
1 Replies

6. UNIX for Advanced & Expert Users

Source code for Unix commands

hi Folks!! Just got a question in mind.... Is it possible for us to read the c code of the commands in the bin directory? I work on a LINUX server and i only see executables in the bin directory which i obviously can't read. Please help me regarding this. Thanks in advance and wishing you a very... (2 Replies)
Discussion started by: bdiwakarteja
2 Replies

7. UNIX for Dummies Questions & Answers

Where can i get unix source code?

Sir please tell me where can i get source code for some unix kernal and shell also. (1 Reply)
Discussion started by: VIPUL15
1 Replies
CGCLEAR(1)							 libcgroup Manual							CGCLEAR(1)

NAME
cgclear - unload the cgroup filesystem SYNOPSIS
cgclear [-e] [-l <filename>] [-L <directory>] [...] DESCRIPTION
Without parameters, this command moves all the tasks inside the various cgroups to the root cgroup, deletes all the cgroups and finally unmounts the cgroup filesystem from the system. If one or more config files are specified, only groups defined in the config files are removed. The files are processed in reverse order, i.e. the last file on command line is processed first, so cgclear can have the same command line arguments as appropriate cgconfigparser. -l, --load=<filename> specifies the config file to read. This option can be used multiple times and can be mixed with -L option. -L, --load-directory=<directory> specifies the directory, which is searched for configuration files. All files in this directory will be processed in alphabetical order as they were specified by -l option. This option can be used multiple times and can be mixed with -l option. -e specifies that only empty groups should be removed. If a group defined in a config file has tasks inside or has a subgroup, it won't be removed. This option works only with -l or -L options. SEE ALSO
cgconfigparser(1) Linux 2009-10-23 CGCLEAR(1)
All times are GMT -4. The time now is 10:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy