Sed delete line with file path

Possible duplicate:
sed: delete using another delimiter

I can replace the line in the file as follows

sed "s|$PATH_WITH_SLASH||" file 

but i can't delete it

 sed "|$PATH_WITH_SLASH|d" file 

The problem is that the symbol | cannot be used for removal. What for?

+4
source share
1 answer

If you use a different character as an address delimiter, you need to use a backslash before the first char. So

 /address/ 

or

 \|address| 
+9
source

All Articles