5

Replacing System.out.println with Logger.println in *.java using SED (spanned over multiple lines)

view full story
linux-howto

http://www.unix.com – Hi, Can anyone help me out for my below problem. I need to replace all System.out.println with Logger.println in *.java using SED (spanning multiple lines) including current & sub-directories. I tried with below command. But it is not replacing when source text is spanned over multiple lines. find -name '*.java' -print -exec sed -i.bak 's/System.*println/Logger.println/g' {} \; System.out.println System . out . println It is able to replace above two statements. But below statement is not able to. System . out . println Also the command needs to be displayed only the li (HowTos)