Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2017-11-18 02:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (277 votes). Check out past polls.

    Notices?