Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 drinking their drinks and smoking their pipes about the Monastery: (11)
As of 2014-12-19 12:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (82 votes), past polls