Path: utzoo!attcan!uunet!cs.utexas.edu!usc!apple!oliveb!mipos3!omepd!merlyn From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.unix.questions Subject: Re: Sed to make global replacements. Message-ID: <5311@omepd.UUCP> Date: 3 Dec 89 23:36:39 GMT References: <37090@ames.arc.nasa.gov> <5306@omepd.UUCP> <1989Dec3.141336.27475@virtech.uucp> Sender: news@omepd.UUCP Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Hillsboro, Oregon, USA Lines: 28 In-reply-to: cpcahil@virtech.uucp (Conor P. Cahill) In article <1989Dec3.141336.27475@virtech.uucp>, cpcahil@virtech (Conor P. Cahill) writes: | > Now, with Perl (of course, you knew it was coming :-), if you had a | > whole directory full of these files, you could perform this | > substitution, saving the original files as filename.bak, with: | > | > % perl -p -i.bak -e 's,\\(12,1/2,g;' * | | First, you forgot an extra \ for the (. | Second, this silently deletes the original files if the filename is | too long on a system V system. I won't argue about System V. No point. It's brain-damaged. However, shame on me for forgetting that Perl makes left-paren a magic char! Larry, can you ever forgive me? Speak to me Larry! We got another 200 pages to write for the book! Larry! Larry???!! (I guess Larry is going to have to proofread my code pretty thoroughly from now on...) Just a (former) Perl hacker, :-) -- /== Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ====\ | on contract to Intel's iWarp project, Hillsboro, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!uunet!iwarp.intel.com!merlyn | \== Cute Quote: "Welcome to Oregon... Home of the California Raisins!" ==/