سؤال

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!

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top