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

"unarchive" script/function?



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