Re: find and replace


Subject: Re: find and replace
From: Peter Q. Olsson (olsson@koyukuk.at.uaa.alaska.edu)
Date: Thu Jul 18 2002 - 16:02:04 AKDT


>
>Upgrading to mhonarc 2.5.8 didn't help.
>
>Whats an easy of doing a find and replace on text in a file?
>
>"r J" to "r J"?
>

perl -i~ -pe "s/r J/r J/g" in_file

replaces the string globally in a modified "in_file", with the old version saved
in "in_file~"

YOu can do it similarly w/ sed, but I am more up on my perl.

PQO

    __________________________________________________________________
   | |
   | Dr. Peter Q. Olsson, |
   | Chief Scientist, Alaska Experimental Forecast Facility |
   | University of Alaska Anchorage |
   | 2811 Merrill Field Drive |
   | Anchorage, AK 99501 |
   | voice: (907) 264-7449 |
   | fax : (907) 264-7444 |
   | olsson@aeff.at.uaa.alaska.edu |
   |__________________________________________________________________|

---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.



This archive was generated by hypermail 2a23 : Thu Jul 18 2002 - 16:03:46 AKDT