10 More Discussions You Might Find Interesting
1. HP-UX
current date command runs well
awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
subtract 30 days fails
awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
Discussion started by: kmarcus
20 Replies
2. Shell Programming and Scripting
Hi All,
I am getting a date from environment variable and want to do some processing by subtracting 2 months from the date passed through the environment variable.
I am trying the following syntax :
date_var=2014-08-31
date_2M_ago='$date_var+"%d%m%y" --$date_var="2 months ago" '... (3 Replies)
Discussion started by: Rahul Raj
3 Replies
3. Shell Programming and Scripting
Hi,
Can you please let me know code for the below (in korn shell)
a) Subtract month(s) from given date
b) Subtract day(s) from give date
c) Subtract month(s) from given timestamp
d) Subtract day(s) from give timestamp (1 Reply)
Discussion started by: tostay2003
1 Replies
4. HP-UX
Hi there,
is it possible to get the actual date minux six months with just a simple command?
It's easy with Linux but on HP Unix (for me) impossible ;)
Best wishes (3 Replies)
Discussion started by: System
3 Replies
5. Shell Programming and Scripting
I have a requirement as follows.
when i pass a date to the perl script, it has to calculate the current date - 8 months and output the date back to the shell script in date format (YYYY-MM-DD).
Current date - 8 months is not constant.. because leap year, and the months jan, mar, may,.... has... (4 Replies)
Discussion started by: kmanivan82
4 Replies
6. UNIX and Linux Applications
Hi
I have a table with name, date in format DD.MM.YYYY.
I need to something like this (I try to explain in pseudo code)
if SYSDATE (current date) minus 6 months > $expiry date
print OK
else print NOK with $name and $expiry date
I know this is possible with Oracle. How to do this... (0 Replies)
Discussion started by: slashdotweenie
0 Replies
7. Shell Programming and Scripting
I am currently running the following Korn shell script which works fine:
#!/usr/bin/ksh
count=`db2 -x "select count(*) from schema.tablename"`
echo "count"
I would like to add a "where" clause to the 2nd line that would allow me to get a record count of all the records from schema.tablename... (9 Replies)
Discussion started by: sasaliasim
9 Replies
8. Shell Programming and Scripting
Guys,
My log files stored in the date format format below(log_20080714072942):
TIMESTAMP=`date +%Y%m%d%H%M%S`
LOG=/log/log_${TIMESTAMP}.log
I'm looking for a shell script which deletes all files which is older than 3 months from today.
Regards,
Bhagat (3 Replies)
Discussion started by: bhagat.singh-j
3 Replies
9. Shell Programming and Scripting
Hi,
I would like to find out how can i calculate a date which is 3 months ago. I intend to run a cron job on the 1st of every month, and calculate the month 4 months earlier from the date. For example, if today's date is 1st May 2007, i would like to return 012007( January 2007).
i can get... (1 Reply)
Discussion started by: new2ss
1 Replies
10. UNIX for Advanced & Expert Users
I have the script which appends month and year to the name of the
file. Now every time when I append the month-year combination I
have to subtract 2 months from the current date and then append
it, since we are sending our vendor 2 months prior worth of data
eveytime.
#! /usr/bin/ksh
... (5 Replies)
Discussion started by: mahekr2000
5 Replies