AWK - Issues with script running at start of month.
I have a script that runs on an AIX 5.3.10.0. It runs perfectly on days that are double digit numbers, but from the 1st to the 9th of the month it runs but does not report anything.
The command in the script is as follows:
I believe that there is an issue with the value that is being assigned to the $d variable, but can not figure out how to get around it. The way the variable is set at the moment with the %d displays the day of the month as a decimal number (01-31), using a 0 as leading space fill. In the file, there is no 0 padding, but an extra space is used (ie instead of 'Mar<space>06 08:27:49' the script will need to locate 'Mar<space><space>6 08:27:49').
I have tried substituting the %d with %e (Displays the day of the month as a decimal number (1-31). In a two-digit field, a blank space is used as leading space fill), and while this works when testing d=$(date '+%b%e') by itself, when I include it in AWK no results are produced.
As noted previously, I know this script works as if I run
by itslef (not including the date parameters), a list of the required data is returned.
Can any one please advise what I need to do in order to make this script work all month round?
Last edited by jimbojames; 03-05-2012 at 08:01 PM..
Hi,
I am trying to run a cronjob. But while doing so I am getting the following error message :-
can't open yourfile in /var/spool/cron/crontabs directory.
No such file or directory
How can I resolve this issue ?
Please help.
Thanks
Please view this code tag video for... (14 Replies)
Hi,
I have an awk script(test.awk) as below which I am trying to execute through the following command and I am getting error as follows. Request your valid inputs on where I am going wrong. Thanks.
:/usr/chandra# awk -f test.awk input.txt
syntax error The source line is 1.
The error... (18 Replies)
Hi All,
I am trying to understand why my system is running at very high. This system is almost out of memory. See below.
swapon -s
Filename Type Size Used Priority
/dev/mapper/VolGroup00-LogVol02 partition 8388600 8235088 -1... (2 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)
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 All,
I am trying to come up with a shell script to count a specific word in a logfile on each day of this month, last month and the month before. I need to produce this report and email it to customer.
Any ideas would be appreciated! (5 Replies)
What I'm looking for is best explained with a little example.
#!/bin/bash
gedit
echo "I need this message to appear while gedit is still running, but it appears only then when I close gedit."
Of course most of the times you want the script to wait, but in this case I want to start a new... (5 Replies)
Hi Everyone,
I am required to write an AWK script that can be run from any directory.
This script finds subscription rates for each subscriber at an interval of 10 mins. I want that just by copy pasting the whole script in shell prompt and giving the input arguments, script must work. Currenty... (4 Replies)