|
|
Subject:
need unix script
Category: Computers > Algorithms Asked by: questioner1234-ga List Price: $10.00 |
Posted:
04 Nov 2004 18:00 PST
Expires: 05 Nov 2004 13:59 PST Question ID: 424631 |
I need a UNIX script. Right now I do this: grep VARIABLE access_log > NEWFILE vi NEWFILE in vi I use this command :1,$s/VARIABLE //g then I save the NEWFILE and I gzip NEWFILE I want this done automatically. So a script like this: >SCRIPT VARIABLE that will output a NEWFILE with the filename in this format www.DATE.TIME.VARIABLE | |
|
|
There is no answer at this time. |
|
Subject:
Re: need unix script
From: padmapani-ga on 05 Nov 2004 08:01 PST |
Its can be done in one line as : grep VARIABLE snmpd.log | sed 's/VARIABLE//g' | gzip > newfile.gzip It can be wrapped in your fave shel/Perl/etc.. |
Subject:
Re: need unix script
From: padmapani-ga on 05 Nov 2004 12:55 PST |
One caveat though.If you are using a shell script you need to enclose sed arguments in double quotes to evaluate the argument variable.Here is the actual script that is wrapper on the script. ------------------------ #/usr/bin/sh grep $1 access_log | sed "s/$1//g"|gzip > new.gz ----------------------- |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |