Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Perl won't run command with "|&"

by ikegami (Pope)
on Sep 19, 2013 at 23:06 UTC ( #1054919=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use String::ShellQuote qw( shell_quote );
    my $cmd = shell_quote('csh', '-c', 'wget http://... |& tee ...');
    my $result = `$cmd`;
    
  2. or download this
    my $cmd = 'wget http://... |& tee ...';
    open(my $pipe, '-|', '/bin/csh', '-c', $cmd) or die $!;
    my $result; { local $/; $result = <$pipe>; }
    
  3. or download this
    my $cmd = 'wget http://... 2>&1 | tee ...';
    my $result = `$cmd`;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2015-07-02 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (40 votes), past polls