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`;