Search code examples
windows-7cmdmks

How do I get MKS sed to output this double quote?


The line

echo xxx | sed "s/xxx/a""b/"

outputs

ab

rather than

a"b

as expected.

What's the fix?


Solution

  • Use below command: $

    echo xxx | sed s/xxx/a\"\"b/

    output will be : a""b

    Please note that ("(quote)should be escaped, so we need to do this twice that's the trick here)