Newbie help: File searching and writing output to new file

Bah, stupid mail mangling programs.

ruby -ne "i=0;open('found-redir-lines.txt','w'){|f|if
/redir/;a=$_;f.puts a;i+=1;puts a if i<2;end}" ex*.log

ruby -ne "i=0;open('found-redir-lines.txt','w'){|f|if
/redir/;a=$_;f<<a;i+=1;puts a if i<2;end}" ex*.log

ruby -ne "i=0;open('found-redir-lines.txt','w'){|f|if
/redir/;f<<$_;print if(i+=1)<2;end}" ex*.log

ruby -ne "i=0;open('found-redir-lines.txt','w'){|f|f<<$_&&(print
if(i+=1)<2)if/redir/}" ex*.log

ruby -ne
"i=0;open('found-redir-lines.txt','w'){|f|f<<$_&&(i+=1)<2&&print
if/redir/}" ex*.log

Is how those lines where meant to be read

And if they get mangled again... there'll be trouble.

ยทยทยท

#####################################################################################
This email has been scanned by MailMarshal, an email content filter.
#####################################################################################