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 *

You May Also Like…

How to Research a CPU Upgrade

How to Research a CPU Upgrade

Upgrade Time! Doing a lot of VMWare Workstation virtualization to create labs for self-study and training. Finding...