Hi all,

I need to compress many files in a directory on server. I use "awk" and "zip" command to compress these files.

By "awk" command, I filter theses file :
*# ls -latr | grep iMAP.med0 | awk '{print $9}'*
iMAP.med0101_agent.trace.20120726153046.tar.gz
iMAP.med0101_agent.trace.20120726152942.tar.gz
iMAP.med0107_agent.trace.20120726154526.tar.gz
iMAP.med0101_agent.trace.20120726154741.tar.gz
iMAP.med0101_agent.trace.20120726154616.tar.gz
iMAP.med0101_agent.trace.20120726154436.tar.gz
iMAP.med0105_agent.trace.20120726154555.tar.gz
iMAP.med0101_agent.trace.20120726154532.tar.gz
iMAP.med0101_agent.trace.20120726154700.tar.gz
iMAP.med0101_agent.trace.20120726154720.tar.gz
I want to compress them to trace_file.zip, and I use the command, but can not zip these files. Which parameters or syntax did I wrong ?
*# ls -latr | grep iMAP.med0 | awk '{ system("zip /tmp/trace_file" $9)}'*
# ls -latr /tmp/ | grep trace_file
#

--
Thank and best regards,
Jack Vo

Reply via email to