Keith Morse wrote:
On Fri, 15 Nov 2002, Joshua Andrews wrote:I'm no programer either :)
Keith Morse wrote:
Okay, I'll bit. Now that metamail has been dropped from psyche, how do I command line decode base64 files. I'm taking a look at a klez trap I'm using in conjuction with procmail. "man -k base64" shows:#!/usr/bin/perl
MIME::Base64 (3pm) - Encoding and decoding of base64 strings
MIME::Decoder::Base64 (3pm) - encode/decode a base64 stream
MIME::Decoder::Gzip64 (3pm) - decode a base64 gzip stream
but no programmer am I. Just looking for a clue, Google is being unusually obtuse for me tonight.
use MIME::Base64;
print decode_base64("_insert_MIME_encoded_here_");
As I said, no programmer I. So with your example above it would be appropriate to feed it with the mimencoded stream via standard input?
Create the following script, name it dec64.pl and make it executable.
------------------------
#!/usr/bin/perl
use MIME::Base64;
print decode_base64(<>);
----------------------------------
./dec64.pl name-of-base64-encoded-file >decoded-file
Beware, I only tested this using my name as a single line in a text file that I encoded with the following script.
--- enc64.pl -----------
#!/usr/bin/perl
use MIME::Base64;
print encode_base64(<>);
------------------------
$ echo Joshua Andrews >x
$ ./enc64.pl x
Sm9zaHVhIEFuZHJld3MK
$ ./enc64.pl x >y
$ ./dec64.pl y
Joshua Andrews
$
-J
--
Psyche-list mailing list
Psyche-list@redhat.com
https://listman.redhat.com/mailman/listinfo/psyche-list