I was able to output the keyword for the whole month using the above command. My approach was:
a. I split the log file to view only certain columns using cut command
b. I did a grep for the month and also a grep for the keyword for the count and finally wc -l to count the number of occurence!
Now, I am planning to use this same command for all the months!
I think we can make use of some kind of loop or whatever to make this more simpler and easier but unfortunately I do not have that kind of programming skill to come up with this kind of script in a short time!
At this point this script satisfies my current requirement. Any additional suggestions will be helpful to refine this script further!
Last edited by vbe; 08-18-2011 at 05:08 AM..
Reason: use code tags please
Hi ,
I am relatively new to unix...
Can u pls help me out to find out if the first day of the month is a working day ie from (Monday to Friday)...using Date and If clause in Korn shell..
This is very urgent.
Thanks for ur help... (7 Replies)
hi friends
I need a shell script which will do the following Task
Enter the month :
if you enter 1 then it ll show you last 1 month's (starting from today).log file in the current directry.
if you enter 4 then it ll show you last 4 month's (starting from today).log file in the current... (2 Replies)
I know I can't schedule this in cron and would have to write a wrapper around my script and schedule it in cron ....but not sure how do to this?
How do I exclude Monday if the 2nd day of the month falls on a Monday?
Thanks.
I tried this:
0 0 2 * 0,2-6 command
And I know this doesnt... (2 Replies)
Hi All,
I need to find the previous month last day minus one day, using shell script. Can you guys help me to do this.
My Requirment is as below:
Input for me will be 2000909(YYYYMM)
I need the previous months last day minus 1 day timestamp. That is i need 2000908 months last day minus ... (3 Replies)
I am using the code below modified from a post I saw here regarding having the script write out future dates. The problem is that instead of making 8/1 it makes 7/32! Please help!
yy=`date +%Y`
mm=`date +%m`
dd=`date +%d`
echo "Today is : $yy $mm $dd"
#!/usr/bin/ksh
date '+%m... (5 Replies)
Hello Experts,
I have a script which i want to run the on last day of every month.
let say I have backup.sh script which i want to run it every month last day.
Can anyone please help :confused:
thanks (4 Replies)
Hello Experts/Guru,
I need a help in running the script on every month last day....
PS: due to some constrain I can't schedule in crontab
Requirement:
On Jan 31st i want to run some script, similarly on Feb 28th, March 31st, April 30th......till Dec 31st.
Please help me by providing... (3 Replies)
Hello Guys,
I have a questions regarding running a shell script every second working day each month.
I have no clue how solve this problem :wall:.
Important is that it has to be the second working (Mo-Fr).
Example: If 1st and 2nd Days of month are Sat and Sun the script must run on 4th day... (5 Replies)
Hi all,
I currently have a UNIX file maintenance script that runs daily as a cron job.
Now I want to change the script and create functions/sub inside it that runs on a weekly or monthly basis.
To run all the scripts' daily maintenance, I want to schedule it in cron as simply maint.sh... (1 Reply)
I am looking for a unix script which could run a job on 2, 4 and 7 working day of the month.
if the days are falling on the saturday/sunday. it should run on the next day.
Thank you.. (9 Replies)
Discussion started by: tradingspecial
9 Replies
LEARN ABOUT V7
zgrep
ZGREP(1) General Commands Manual ZGREP(1)NAME
zgrep - search possibly compressed files for a regular expression
SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename...
DESCRIPTION
Zgrep invokes grep on compressed or gzipped files. These grep options will cause zgrep to terminate with an error code:
(-[drRzZ]|--di*|--exc*|--inc*|--rec*|--nu*). All other options specified are passed directly to grep. If no file is specified, then the
standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep.
If the GREP environment variable is set, zgrep uses it as the grep program to be invoked.
EXIT CODE
2 - An option that is not supported was specified.
AUTHOR
Charles Levert (charles@comm.polymtl.ca)
SEE ALSO grep(1), gzexe(1), gzip(1), zdiff(1), zforce(1), zmore(1), znew(1)ZGREP(1)