lkml.org 
[lkml]   [2011]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] quilt mail: Add way to sign mail with GPG
On 10/12/2011 02:56 AM, Andreas Gruenbacher wrote:
>
>> As for removing the temp file, I just found it was the easiest way to
>> pipe into gpg. If there's a better way to do that, I'm all ears.
>
> ... how about this approach?
>
> my @lines = <>;
> map { print } @lines;
> print "\n";
>
> #-----------------------------------------------
>
> sub crlf($) {
> my $_ = shift;
> #s/\n$/\r\n/;
> s/^/> /;
> return $_;
> }
>
> my $command = 'tr a-z A-Z';
> open(PIPE, "| $command")

open(PIPE, '|-', $command);

... please; better yet with a list (@command) so it doesn't doesn't pass
through the shell.

-hpa


\
 
 \ /
  Last update: 2011-10-12 21:01    [W:0.036 / U:1.916 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site