Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re: CX or System

by Eliya (Vicar)
on Apr 04, 2012 at 19:03 UTC ( #963510=note: print w/ replies, xml ) Need Help??

in reply to CX or System

qx acts like a double-quoted (interpolated) string, so you need to escape stuff, i.e.

my $dbpass=qx{ password_decode \$(grep "name=\\"db\\"" /opt/SecureSphe +re/etc/bootstrap.xml|cut -d\\" -f4) };


Alternatively, declare your command using a non-interpolating quoting mechanism, and then pass it to qx{}:

my $cmd = q{ password_decode $(grep "name=\"db\"" /opt/SecureSphere/et +c/bootstrap.xml|cut -d\" -f4) }; my $dbpass = qx{ $cmd };

Hint: replace qx{} with qq{} and print it, and you'll see what the shell sees with your version, e.g.

password_decode 999 101 104 814 999 1035 1070grep "name="db"" /opt/Sec +ureSphere/etc/bootstrap.xml|cut -d" -f4)

Comment on Re: CX or System
Select or Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2015-11-28 20:37 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (744 votes), past polls