From: w_a_x_man@... Date: 2009-01-06T05:10:03+09:00 Subject: Re: Ruby Command Line One Liner On Jan 1, 1:51 pm, Alain Helfenstein wrote: > Hi, > > I try to write a Ruby one-liner that replaces the header information of > some *.java files. > > My first try worked perfect for a single file. But I have no idea on how > to change my one-liner to work with multiple files. > > Here is my one-liner for a single file: > > ruby -i.bak -p -e 'puts ARGF.read.gsub(/.*(?=package)/m,"/**\n * foo.bar > 2001-2009\n\ **/\n")' test/Test.java > > Does anybody have a idea on how to solve this problem for all *.java > files in the test directory? > > Thanks for your answer, > Alain. > -- > Posted viahttp://www.ruby-forum.com/. ruby -i.bak -0777 -pe"sub /.*foo/m,'bar'" *.java