sed script question

Logan Rathbone logan.rathbone-H217xnMUJC0sA/PxXw9srA at public.gmane.org
Tue Jan 18 05:12:52 UTC 2005


On Mon, Jan 17, 2005 at 11:50:02PM -0500, jim ruxton wrote:
> I'm trying to write a script and in it one of the things I want to do is
> get rid of [ characters. When I try using sed as in:
> sed s/"["/" "/g  

Try using backslash (\) as an escape character, followed by the
character you want to be replaced.  Also, you don't need to use all
those quotation marks to mean "nothing."  Try it like this:

sed s/\[//g

> I get an error message saying it is an unterminated s command. I have a
> feeling this is because [ is a special character. I thought however
> putting quotes around it would take care of this. Any thoughts on what
> I'm doing wrong? Thanks.

-- 
Q:	What's the difference between a dead dog in the road and a dead
	lawyer in the road?
A:	There are skid marks in front of the dog.
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list