I want a variable service to be replaced by string $ service I used sed for
The problem is that the special characters in the variable $ service such as '$ [,], /, \,', and Similar is the sequence of special characters in the $. Service and whenever a particular character is "within the service", but fails to change it correctly is there a solution in which The remaining characters will not interfere in the sed replacement process? The answers given below do not work for me, it is called Try doing this: Ex . sed "/ SERVICE / $ service / g"
sed: -e expression # 1, for character 107: `s' Unknown option
Sed @ s @ SERVICE @ $ (printf '% q' $ Service ") @ g"
@ is an alternative modifier, which Any letter can be
printf '% Q' shell:
$ printf '% q' '* $!' \ * \ $ \!
No comments:
Post a Comment