Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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?
[LanX]: choroba deaf after one rehearsal per year ?
Discipulus .. per ear!
[LanX]: LOL
[choroba]: we used to play more :)
Discipulus played the guitar in a ska band 12 elemnts, very fun
[LanX]: well ... the prize for worshipping satan is high ...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (9)
As of 2017-03-24 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (301 votes). Check out past polls.