Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^6: System command using array and pipe

by ikegami (Pope)
on Jun 06, 2011 at 20:17 UTC ( #908360=note: print w/replies, xml ) Need Help??


in reply to Re^5: System command using array and pipe
in thread System command using array and pipe

I prefer
my ($passwd_lit, $path_lit) = map text_to_shell_lit, $passwd, $path; system("mysqldump --add-drop-table -uroot -p$passwd_lit mydatabase | g +zip -9c > $path_lit");
to
my $passwd_lit = $passwd; my $path_lit = $path; s#'#'\\''#g for $passwd_lit, $path_lit; system("mysqldump --add-drop-table -uroot -p'$passwd_lit' mydatabase | + gzip -9c > '$path_lit'");

but to each his own.

By the way, your quoting was buggy. "\" is not special in sh single-quoted literals.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://908360]
help
Chatterbox?
[LanX]: The old chromosone question ... Why Y???
[zentara]: Y succeeds X then preceeds Z . There is a deep meaning in that :-)
[zentara]: unicorns have a Z chromosome
shmem lives in a city which has the unicorn in its emblem

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (10)
As of 2017-03-30 16:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (362 votes). Check out past polls.