From: nobu.nokada@... Date: 2002-12-07T11:45:42+09:00 Subject: Re: File Hi, At Sat, 7 Dec 2002 04:52:16 +0900, Daniel Carrera wrote: > I want to read each line, process it, print that to another file, and then > rename the output file. This is how I'd do it in Perl: > > open ORIG, "<$filename"; > open TEMP, ">.$$.tmp"; > > while () { > s/
//g;
>     s/<\/pre>/<\/code>/g;
>     print TEMP
> }
> close ORIG;
> close TEMP;
> 
> rename ".$$.tmp", "$filename";

$ ruby -pi -e "gsub!(%r[<(/?)pre>], '<\1code>')" filename

-- 
Nobu Nakada