Hi,
I found the following biweekly script by searching google:
###############################################
why not schedule it weekly, cache the "date" of the last run to a
file, and then at the beginning of your shell script
compare the current date with the cached date and only approach to the
real code when they are two-week difference.
This logic should be very easy to implemen
Dear all, today I'm scratching my head with a simple (I believe) issue.
Working with date is quite simple, so if I Need to add some seconds to current time, I'll use:
Code:
date --date='+30 seconds' +"%Y-%m-%d %H:%M:%S"
But, how to pass the value to add from a variable?
Hi all,
I have used a bash script which ultimately converts a string into date using date --date option:
Code:
DATE=$DATE" "$TIME" "`date +%Y` //concatenating 2 strings
TMRW_DATE=`date --date="$DATE" +"%s"` //applying date command on string and getting the unixtime
Moderator's Comments:
I have dates as follows in a file
Code:
20121029135649
20121029135721
20121030091540
20121030093420
20121030094340
20121030095427
20121030095856
20121030100104
20121030100251
All these dates are in sorted order.
I need a script to search for *.LOG in a directory, output the line after the current date and yesterday's date and also output the next 5 lines after the current date and yesterday's date
I have tried following commands, still no result
Code:
Currentdate=`date -u +"%m/%d/%y"`
awk '/$Currentdate/{getline; print}' *.LOG
The log has data for the whole month for which I need only the
Hi,
I am trying to display future date from the current date but unable to do so in UNIX (not in PERL). For eg: if today is March 5 then I want a variable wherein I can store Mar 7 date, but unable to get the future date from the current date.
I have tried many possible ways as mentioned below but all in vain.
Hi friends,
I would like to compare two dates in an IF statement.
This is what I am trying, but it doesn't work.
Code:
date=20120122
minus=6
if [ $date < `date -d "-'$minus' days" +%Y%m%d` ]; then
...
fi
what would the IF clause looks like?
Thanks! :)
Hi Guys,
I have a file with following content
Code:
From 20121014 : To 20121014
Number of days : 1
1234
1245
1246
1111
Everyday i run my script i want to modify "To" date on the first line with current date. I have set the current date in script as
Code:
RUN_DATE=`date -u +%Y%m%d`
So i want to replace "To" date with $RUN_DATE.
Hi All,
I have a quick question with regards to SED syntax, and I hope someone here can help me out.
I have some text based reports in which I would like to strip the "Current Date" from and replace with equivalent number of empty spaces, for every occurrence.
For example, here is what I need to strip: