10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello all,
Info:
System RedHat 7.5
I need to create a script that based on the creation time,
if the file is older then 5 minutes then execute some stuff, if not exit.
I thought to get the creation time and minutes like this.
CreationTime=$(stat -c %y /tmp/test.log | awk -F" " '{ print... (3 Replies)
Discussion started by: charli1
3 Replies
2. 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
3. UNIX for Dummies Questions & Answers
Hi,
I am reading a particular date from a file using below command
WFLWDATE=$(sed '2q;d' FileA.prm)
The echo command outputs the correct date in variable WFLWDATE
Now I want to subtract 5 minutes from this variable. I am on AIX and unable to get anything working as expected.
Can you... (1 Reply)
Discussion started by: vrupatel
1 Replies
4. 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
5. 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
6. 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
7. Shell Programming and Scripting
OK, I am by no means a programmer...
I have been given the task to do some automation scripts. I have got most of it working from snippets I have found on the Web.
One requirement has me stumped.
The initial timing file created by the user is a comma delimited in the following format.... (4 Replies)
Discussion started by: autotuner
4 Replies
8. Shell Programming and Scripting
need some help on the below requirement:
File1:
SV,22,20100501140000,JFK,RUH
SV,29,20100501073000,BOM,RUH
SV,29,20100501073000,SIN,RUH
third filed is datetime which is of the format (yyyymmddhh24miss)
File2
JFK,+,0500
BLR,-,0530
SIN,-,0800
for every line of file 1, take 4... (9 Replies)
Discussion started by: ssantoshss
9 Replies
9. 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
10. 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