Pergunta

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!

Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top