10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, please can somebody let me know the easiest way to add days to a date.
I can do this in perl but would like to able to do it in a shell script.
Desired output would be:
date +'%Y-%m-%d' + 10 = 2016-05-02
Thank you (8 Replies)
Discussion started by: andy391791
8 Replies
2. Shell Programming and Scripting
Hi All,
I want to add one day to a date and store it in a variable.
From GUI we are passing value (last day of the month)to $t_date.
This $t_date will give me the value like this %Y%m%d 20150531.
Now I want to add one day to this value and store it in a variable "datein".
datein should... (8 Replies)
Discussion started by: ROCK_PLSQL
8 Replies
3. UNIX for Advanced & Expert Users
Hi All,
Please let me know the error in the below code.
m=(0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
M=$(date +%m)
Y=$(date +%Y)
if ; then
M=01
Y=$(($Y+1))
else
M=$M+1)printf "01-%s-%d\n" ${m} $Y
fi
Log:
+ m=(0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
++... (4 Replies)
Discussion started by: kiranparsha
4 Replies
4. Shell Programming and Scripting
Hi ,
How can I add/substruct x number of days with date?
For example
My_Date=`date`
Now I need
Hope it's clear. (2 Replies)
Discussion started by: Anupam_Halder
2 Replies
5. Shell Programming and Scripting
I want this:
0.0230769,0.407692,0.307692,0,0.1,1.4,1,0,ADD DATE HERE,
im getting this:
11/02/12
0.00192308,0.0269231,0.0192308,0,0.1,1.4,1,0,
my script:
#!/bin/ksh
DIR=/export/home/yani_m/scripts/scrip_out_put/
DIR2=/export/home/yani_m/scripts/scrip_out_put/calc/
Date=$1... (1 Reply)
Discussion started by: LucyYani
1 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I want to add some hours and minutes to the current date. For example, if the current date is "July 16, 2012 15:20", i want to add 5 hours 30 minutes to "July 16, 2012 00:00" not to "July 16, 2012 15:20". Please help.
Thanks! (4 Replies)
Discussion started by: manojgarg
4 Replies
7. Shell Programming and Scripting
Hi! I am trying to read a file and every line has a specific date as one of its fields.
I want to take that date and compare it to the date today plus 6 days.
while read line
do
date=substr($line, $datepos, 8) #date is expected to be YYYYMMDD
if ; then
...proceed commands
... (1 Reply)
Discussion started by: kokoro
1 Replies
8. Shell Programming and Scripting
i have some files in my directory....wit names say aaa, bbb, ccc,,,,,
i want to make loop so that for each file name,,,,,,a sysdate should be appended in the end.........and the files should look like aaa_20100331
i knw date can be appended as `date +"%Y%m%d"`
but m nt able to make a loop. ... (2 Replies)
Discussion started by: amitpta
2 Replies
9. UNIX for Dummies Questions & Answers
I want to add a date to a record which is appended to a file that gets its data from an external source. An explanation:
1. Getting external data: curl http://www.example.com/temperatures.txt
2. Getting the required record: | grep mylocation
3. Appending to file: >> mytemperatures.txt
... (2 Replies)
Discussion started by: figaro
2 Replies
10. Shell Programming and Scripting
Hi. I'm trying to output the current date to a cronjob log file. Nothing seems to work, echo $(date), echo `date` or just date in the script. I'm using /sbin/sh
Any ideas? Thanks, John (2 Replies)
Discussion started by: JohnH
2 Replies