Escaping Perl oneliner single quotes when run from a bash shell

Google said perl -le 'print…

Login

Blog History

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.