pipe to unzip - unzipout

So I noticed a couple of weeks that I couldnt unzip from a pipe like this:

cat archive.zip | unzip

Which is annoying because I don't like to download zip files just to unzip and then delete them.

Of course you could run all of the commands yourself, but its scripting and we are smarter than that.


Well now you can just by running this  *NOTE* THIS IS A SINGLE COMMAND, NO LINEBREAKS

´╗┐´╗┐alias unzipout="python -c \"import zipfile,sys,StringIO;zipfile.ZipFile(StringIO.StringIO(sys.stdin.read())).extractall(sys.argv[1] if len(sys.argv) == 2 else '.')\""


and then doing this:


cat archive.zip | unzipout


Another annoyance fixed.


Now if only grep worked the way I expect.

Latest comments