Frage

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!

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top