in reply to using a pipe
Given the syntax of your command line interface to gpg, this should do the exact same thing, though via perl.#!/usr/bin/perl use strict; use warnings; # First, open the file and read the contents... assuming one line open my $file, 'encrypted_file_name' or die "ERROR:\t$!\n"; my $enc_pass = shift( @{ [ <$file> ] } ); close $file; # Next, pipe the contents to gpg open my $gpg_command, "/usr/bin/gpg --option newfile oldfile | " my $gpg_out; while ( <$gpg_command> ) { $gpg_out .= $_; } close $gpg_command; print "$gpg_out\n"; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: using a pipe
by drock (Beadle) on Dec 30, 2005 at 03:25 UTC | |
by wazzuteke (Hermit) on Dec 30, 2005 at 15:28 UTC |