Skip to main content
fix damage caused by robotical edit
Source Link
user313992
user313992

You need to escape the special characters with a backslash \ in front of the special character. For your case, escape every special character with backslash \.

eg: **** boy is ******** boy is ****

sed 's/\\*\\*\\*\\*\*\*\*\*/sam/g' filename

ans :

sam boy is sam

You need to escape the special characters with a backslash \ in front of the special character. For your case, escape every special character with backslash \.

eg: **** boy is ****

sed 's/\\*\\*\\*\\*/sam/g' filename

ans :

sam boy is sam

You need to escape the special characters with a backslash \ in front of the special character. For your case, escape every special character with backslash \.

eg: **** boy is ****

sed 's/\*\*\*\*/sam/g' filename

ans :

sam boy is sam

You need to escape the special characters with a backslash \\ in front of the special character. For your case, escape every special character with backslash \.

eg: **** boy is ****

sed 's/\\\\/sam/g' filename

sed 's/\\*\\*\\*\\*/sam/g' filename

ans : sam boy is sam

sam boy is sam

You need to escape the special characters with a backslash \ in front of the special character. For your case every special character with backslash .

eg: **** boy is ****

sed 's/\\\\/sam/g' filename

ans : sam boy is sam

You need to escape the special characters with a backslash \ in front of the special character. For your case, escape every special character with backslash \.

eg: **** boy is ****

sed 's/\\*\\*\\*\\*/sam/g' filename

ans :

sam boy is sam
Source Link

You need to escape the special characters with a backslash \ in front of the special character. For your case every special character with backslash .

eg: **** boy is ****

sed 's/\\\\/sam/g' filename

ans : sam boy is sam