Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^3: backslashes in shell commands

by kcott (Archbishop)
on Mar 09, 2013 at 05:36 UTC ( [id://1022532]=note: print w/replies, xml ) Need Help??


in reply to Re^2: backslashes in shell commands
in thread backslashes in shell commands

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1022532]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-24 09:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found