Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: Sed to make global replacements. Message-ID: <2698@auspex.auspex.com> Date: 8 Dec 89 18:40:53 GMT References: <37090@ames.arc.nasa.gov> <3369@jarthur.Claremont.EDU> Reply-To: guy@auspex.auspex.com (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 24 >Try > sed 's/[\\](12/1\/2/g' or just sed 's/\\(12/1\/2/g' since, as you note: >Two backslashes are used since the backslash has special meaning to sed >and must be escaped (with another backslash). so escaping the backslash with another one is sufficient. (Yes, I tried it.) In addition >The slash (or virgule, if you will) that is used to separate the '1/2' must >also be escaped to prevent sed from using it as the delimiter of the >substitution command. Or you can do sed 's;\\(12;1/2;g' using ";" as the delimiter, or any other character.