Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: "unarchive" script/function?



tar now natively understands (at least) gzip, bzip2, lzma and compress.

so, eg, tar tvf foo.tgz "just works".

See http://www.gnu.org/software/tar/ for details.  tar does not seem
to understand zip format, though.

Regards,


On Wed, Jan 7, 2009 at 11:18 AM, TjL <luomat@xxxxxxxxx> wrote:
> Years ago I remember seeing a function that someone had posted (to
> this list, I believe) which would unarchive a whole bunch of different
> formats.
>
> Basically I want to be able to throw any kind of archive/compression
> method and have them all dealt with, so I could theoretically do this:
>
>
>         unarchive file1.zip file2.tar file3.tbz file4.tar.gz
>
>
> and the "unarchive' program would know what to do with each.
>
> I wrote something of my own, but I can't get it to figure out what to
> do when there is a .tar.gz instead of a .tgz (i.e. two file
> extensions). It ends up seeing .gz and just gunzip'ing. I'm not great
> at regex matching, and I'm sure there's a better way than what I'm
> doing.
>
> Before I re-invent the wheel, does anyone have something like this
> already written up?
>
> TjL
>
>



Messages sorted by: Reverse Date, Date, Thread, Author