Escaping Perl oneliner single quotes when run from a bash shell

Written by James McDonald

March 5, 2009

Google said

perl -le 'print "It\047s True";'

But after playing around for a while I found this worked:

perl -le 'print "It''\'\''s True";'

Thats double quote It single quote singlequote backslash singlequote backslash singlequote singlequote s True double quote 🙂

Enjoy.

BTW Ubuntu 8.04

1 Comment

  1. kykyboss

    nice one, you just saved me a lot of time (and fustration)

    Reply

Submit a Comment

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.

You May Also Like…

Meraki Open Source Licenses

Until today I assumed that Meraki was built in-house with only closed source software. But having a look at the...

VEEAM FAILS

If you have Veeam backup failing with the Updating BCD failed with Cannot update SafeBoot flag and SentinelOne is...