Question

I am looking for a Unix command that enables to "source" the text in a gzip compressed text file.

If my explanation is not clear enough, I mean to a command that first unzips the file and then runs the original command on it, like zgrep, zcat, zless, etc. do

Thanks!

Was it helpful?

Solution

Elaborating shellter's approach, you could use

eval `gunzip -c file2source.gz|tr \\n \;`

for simple scripts. (I say simple because the command lines in the file are concatenated into one line.)

Other than that,

to unzip into a real file, and source that,

seems to be the only way.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top