I have the same Perl version as you but a different O/S:

$ perl -v This is perl 5, version 14, subversion 2 (v5.14.2) built for darwin-th +read-multi-2level ... $ uname -a Darwin ganymede 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25: +48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64

It would appear that I gave you something of a bum steer regarding escaping the single quotes - sorry about that. Removing the two backslashes before the single quotes does not alter the outcome for me:

$ cat pm_sh_escape.pl #!/usr/bin/env perl use strict; use warnings; my $cmd = "printf 'I\\x27ll'"; print $cmd . "\n"; print `$cmd` ."\n";
$ pm_sh_escape.pl printf 'I\x27ll' I'll

Checking directly in the shell, I get the same result as you:

$ printf 'I\x27ll' I'll

Unfortunately, that all adds up to an inability to reproduce your problem.

-- Ken


In reply to Re^3: backslashes in shell commands by kcott
in thread backslashes in shell commands by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.