You escaped the backslash: that worked fine. What you didn't do was escape the single quotes.
#!/usr/bin/env perl use strict; use warnings; my $cmd = "printf \'I\\x27ll\'"; print $cmd . "\n"; print `$cmd` ."\n";
Output:
$ pm_sh_escape.pl printf 'I\x27ll' I'll
Update: Escaping the single quotes was not the answer - see discussion below.
-- Ken
In reply to Re: backslashes in shell commands
by kcott
in thread backslashes in shell commands
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |