04-30-2010
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
Im writing a script using the ksh shell. I have 2 variables in the script:
CURRTIME
PREVTIME
Example, if CURRTIME=13:00, I want to somehow calculate what the time was an hour ago so that PREVTIME=12:00
Right now I have the following:
CURRTIME=`date +%H:%M`
How can I... (4 Replies)
Discussion started by: xadamz23
4 Replies
2. Shell Programming and Scripting
i have the time 20100421043335 in format (date +%Y%m%d%H%M%S),and i want to be able to get the previous time 2 minutes ago,which is
20100421043135 (9 Replies)
Discussion started by: tomjones
9 Replies
3. Shell Programming and Scripting
Hi guys.
I am trying to subtract 10 minutes from the current Unix system date and time. I have the datecalc provided here but it is mainly the date and not the time. Please check on how can i subtract 10 minutes from the current time using datecalc or any other shell scripting that will... (2 Replies)
Discussion started by: bantiloe
2 Replies
4. Shell Programming and Scripting
HI Guys,
I want to find out the script running time and subtract from sleeptime.
My Script Below Give me error :-
#!/usr/bin/ksh
timeout=100
start=$SECONDS
sleep 20
end=$SECONDS
echo "Time: $((end - start)) "
ScTime = $((end - start)) (1 Reply)
Discussion started by: asavaliya
1 Replies
5. Shell Programming and Scripting
Hello all,
I have written sth like this:
#!/bin/bash
grep -e XXX -e YYYY myfile.log | grep -v ZZZ | awk '{print $1 " " $2 ";" $3 ";" $9 ";" $11}' > myfile.csv
sed -i '1iDate;Time;From;To' myfile.csv
=> it is clear that it converts log to csv and add a header.
Now I want to subtract row... (4 Replies)
Discussion started by: frhling
4 Replies
6. Shell Programming and Scripting
Hello,
I am writing a script to find time difference between two timestamp stored in a variable.
i have two variable
t1=11:48:30
t2=13:13:48
how i can find the difference i.e t2-t1 in seconds.
Please help (4 Replies)
Discussion started by: anand2308
4 Replies
7. Shell Programming and Scripting
Hello All,
I am working on script where I need to add hours,minutes or seconds in the time.Time is not the current but it could be future time.I thought I can store that time in variable and add hours.minutes or second but I am not able to add that in the time that is stores in a variable.
Time... (9 Replies)
Discussion started by: anuragpgtgerman
9 Replies
8. Shell Programming and Scripting
the given time is:
12:13:00
how do i subtract a 10 minutes from any given time?
date '12:13:00' '-10 min'
also tried this:
date +12:13:00 '-10 min' (2 Replies)
Discussion started by: SkySmart
2 Replies
9. UNIX for Dummies Questions & Answers
Hello All ,
Please support for below request
how to change format and subtract time and date and get average.
xxx 13-OCT-15 11.32.18.241000 AM 13-OCT-15 11.35.49.089080 AM
xxx 13-OCT-15 11.32.24.000000 AM 13-OCT-15 11.45.17.810904 AM
xxx 13-OCT-15 11.32.25.232000 AM ... (1 Reply)
Discussion started by: mirwasim
1 Replies
10. Shell Programming and Scripting
INPUT:
16:45:51 10051 77845
16:45:51 10051 77845
16:46:52 10051 77846
16:46:53 10051 77846
Match the last PID then subtract second line time with first line.
Please help me with any command or script. (3 Replies)
Discussion started by: vivekn
3 Replies