bash - linux get filecontent as stdio after pipe -


i have linux command reads stdio , generates simple file per hour:

myapp > ~/$( date "+%y%m%d%h.txt" ) 

then, because myapp can read stdio clear text files , input files zipped, use zcat read files , send them previous processing:

zcat myfile.zip | myapp > ~/$( date "+%y%m%d%h.txt" ) 

so far, fine. problem need read variable-name file , continue process it, eg, send file content 'head' command. try:

head $( zcat myfile.zip | myapp > ~/$( date "+%y%m%d%h.txt" ) ) 

without sucess. , don't want create variable because process can take more 1h go.. , maybe diferent filename variable in head:

zcat myfile.zip | myapp > ~/$( date "+%y%m%d%h.txt" ) ) && head ~/$( date "+%y%m%d%h.txt" ) 

so, think best way this?

thanks all.

why not store first on variable?

filename=$( date "+%y%m%d%h.txt" ) zcat myfile.zip | myapp > ~/"$filename" && head ~/"$filename" 

Comments

Popular posts from this blog

android - Invite new users for my app using app notifications facebook -

Need help in packaging app using TideSDK on Windows -

html - CSS: Combine Texture and Color -