Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Redirect output of the system() command

by Gangabass (Priest)
on Jul 11, 2012 at 08:21 UTC ( #981048=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Redirect output of the system() command
in thread Redirect output of the system() command

A bit modified version (as soon as I need to quote some options too):

my @options = qw( --orientation Portrait --page-size A4 --title "Rechnung" --footer-right "created by Manager www.somesite.ch" ); $config->{wkhtmltopdf_path} =~ s{ }{\\ }g; $source_file =~ s{ }{\\ }g; $config->{result_filename} =~ s{ }{\\ }g; my $command = "(" . join(" ", $config->{wkhtmltopdf_path}, @options, $ +source_file, $config->{result_filename}) . ")"; $command =~ s/\"/\\\"/g; system( "/bin/bash -c \"$command\" >/dev/null 2>&1" );


Comment on Re^3: Redirect output of the system() command
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (14)
As of 2014-08-27 13:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (238 votes), past polls