[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PERL] Søg og erstat -> Hurtigt hack ønskes!



Peter Toft wrote:
> 
> perl -i -pe 's/andeby/gåserød/gi'
> er en sød lille ordre til at erstatte alle andeby med gåserød.
> 
> Men hvad gør jeg midt i et Perl program, hvis jeg har
> filnavn : $filename
> frastreng : $froms
> tilstreng : $tos
> 
> og vil erstatte alle $froms med $tos i $filename
> resultatet skal også efterlades i $filename.

system("sed -e 's/$froms/$tos/g' < $filename >$filename+ && mv
$filename+ $filename");

man kører vel unix!

-- 
René Seindal (sslug@sslug)			http://www.seindal.dk/rene/


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 19:52 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *