On Fri, Sep 24, 1999 at 04:47:00PM +0200, Eric Smith wrote:
> Maybe this is not really a mutt question.
>
> I have the following line(s) in my .mailcap which is most useful:
>
> application/zip; /usr/bin/unzip -d/var/tmp/unzipped/ %s
> application/x-zip-compressed; /usr/bin/unzip -d/var/tmp/unzipped/ %s
>
> As you see, it unzips a zip attachment automatically when I press on it, now
> is it possible to have the routine prompt me for what destination dir I wish to
>unzip to?
>
This does exactly what you asked for and is much shorter than the one I
posted a while back.
#!/usr/local/bin/perl
$file = $ARGV[0];
$base = $file;
$base =~ s?\.gz??;
print "Type the directory name where you wish to save the file: ";
$dir = <STDIN>;
chop($dir);
system "/usr/local/bin/gunzip $file";
system "cp $base $dir";
unlink $base;
Cheers, Brian.
--
Associate Professor Brian Salter-Duke (Brian Duke)
Chemistry, Faculty of Science, IT and Education, Northern Territory University,
Darwin, NT 0909, Australia. Phone 08-89466702. Fax 08-89466847
[EMAIL PROTECTED] http://www.smps.ntu.edu.au/school/compchem.html