I'll make this short... Is there any good way to get the day number that first matches the Monday column from the cal command output with awk (or any other text manipulator commands) ?
I'm sorry if my question wasn't clear at all.
For example...
One cal output would be
Now, what I really need to get is the number of the first Monday in the month (I might also need, for example, the 3rd number of the Friday column, or any other number related to day that I need from that output).... In this case that would be the 7. I cannot think of anything since I have to consider that Monday might also be 1 or 2 in the 3rd line.....
Any idea?? I need this in order to setup a backup script for crontab, since as you know crontab is a little bit dumb.... but that doesn't matter.
Any help will be appreciated, thank you all in advance
Sorry scottn, I don't get your post and don't understand why you deleted it.. (maybe language misunderstood)
Jim, yep that's why I was I asking this, my problem is something similar to that thread, I'll be reviewing that command. I've seen alot of answers regarding this issue, but I couldn't make work any of them. However, I came across with a post in a another forum where someone posted something that Perderabo came up with, that is
Maybe putting that script in the crontab telling it ro be ran on every monday (for example) will work..
SFNYC, unfortunately I don't have (and cannot install since it's a client LPAR) Date::Manip module.
Thank you all for your fast answers, this is very helpful.
In the below awk I am trying output to one file those lines that match between $2,$3,$4 of file1 and file2 with the count in (). I am also trying to output those lines that are missing between $2,$3,$4 of file1 and file2 with the count of in () each. Both input files are tab-delimited, but the... (7 Replies)
Using the attached file, the below awk command results in the output below:
I can not seem to produce the desired results and need some expert help. Thank you :).
awk -F'' '
{
id += $4
value += $5
occur++
}
END{
printf "%-8s%8s%8s%8s\n", "Gene", "Targets", "Average Depth", "Average... (3 Replies)
Hi All,
I'd like to create a specific output filename for AWK.
The file I am processing with AWK looks like:
output_081012.csv*
27*TEXT*1.0*2.0*3.0
where * is my delimeter and the first line of the file is the output filename i'd like to create
is there a way to assign an awk... (10 Replies)
hi all
I would like to help me find the problem with this script to find and print to the screen a specific date of a log file that I have on my server, the date it is received as the first argument in the script $ 1
Here I show you a few lines that made the idea of my log file:
****... (4 Replies)
I have a function to center output in a terminal. However It only works for variables. I would like to center the output of the command 'cal' or 'cal -3' in a terminal.
I have tried:
center `cal`
CAL=`cal`; center $CAL
cal > cal.txt; center `cat cal.txt`
center "`exec cal`"
To no avail,... (10 Replies)
I have a script which archives log file events which are 90-days old. Script works fine but I wanted some input on one aspect of this script. My nawk statement, bolded below, that removes events 90-days prior from today, I need it to find anything 90-days or older. The log file date pattern looks... (0 Replies)
helo
i want to show today date and calendar when v succesfuly login on the system on the linux server
please orovide the sol for the same
thanx :):):) (1 Reply)
Cal
Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
cal | awk '{print $7}'
Sat
13
20
27
In the above output i am missing 6 because the first column is empty so it is shfting.
How... (3 Replies)
Hi Gurus,
In my Cal output i want to cut the date of 2nd saturday how tyo achive this.
for eg in the below output i need that second saturday 13 to be cut.
crypto $ cal
January 2007
S M Tu W Th F S
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26... (2 Replies)