1

I work for a webhost as a front level tech and often we need to install a SSL for a customer. I'm on a Mac now but am familiar with Linux as well.

What I'm looking to do would be to take the zipped file, download it to my mac and then run the command to both unzip it and cat at one pop. Thus eliminating the tedious process of unzip file.zip and then copy each file, one at a time to run cat.

I'm lame when it comes to writing a script and have played around with multiple commands, none that worked out.

Thank you for any interest and suggestions in advance.

This may be of some interest to others out there too that might could use this to improve their workflow as well.

3 Answers 3

0

You probably need a combination of curl (or wget) and unzip with -c option.

1

I don't have a Mac to test with, but on linux you can issue gunzip -c or zcat to unzip the contents of a file and write the data to standard output.

1

I actually found a way to do this with the help of a friend at work tonight.

#!/bin/bash
#Script to run unzip and cat in one command

zipinfo -1 $1 > $1.txt;
unzip $1;
for i in $(cat $1.txt); do echo "File : $i >>" && cat $i; done

Saved it in TextWrangler as uzipcat.sh and ran chmod u+x

To run it I type ./uzipcat.sh sslfilename.zip and it extracts it plus prints the contents.

Thanks for the interest and suggestions!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .