On Jul 26, 2012, at 5:14 AM, Rob Coops wrote:

> On Thu, Jul 26, 2012 at 12:05 PM, Jack Vo <jacksvo2...@gmail.com> wrote:
> 
>> 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
>> 
>> Hi Jack,
> 
> Sorry but how is this related to perl? This is a linux/unix question that
> most on this list might be able to answer but that does not mean it belongs
> on this list.
> 
> Rob.

Well, this can be done in perl, so if the OP wants a perl solution we can offer 
help with that.

Bill

(sorry about sending this to you personally Rob, I clicked the wrong "reply" 
button :(
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to