sed doesn't work

Hello
I' m confused a bit.
I want to replace string "&amp" with "&" using this command.

sed 's/&amp/&/g'

and it doesn't work. Nothing happens.

On the other side this works:
sed 's/&amp/@/g'
or sed 's/&amp/^/g' !!!

Can somebody help please?
Thanks

& is a special character. Put a back slash in front of it

It works. Thank you very much 98_1LE. :slight_smile:

man sed

"&" is expanded to the whole text matched by the regular expression in the search part.

Example: You want to add "== " at the beginning and " ==" at the end of every line:

's/.*/== & ==/'

The "&" will contain whatever is matched by ".*" (this is the whole line) and will put it in the result string, the rest of the result string is literal.

bakunin