Skip to content

Escape single quotes in bash

  • by

Some helpful instructions on Stuart Colville’s blog explain how to do this.

To produce e.g. abc'def, you need to enter

$echo 'abc'\''def'

The '\'' first closes the single quotes, then puts a literal (escaped) ' and then opens single quotes again.

Leave a Reply

Your email address will not be published. Required fields are marked *