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
Hi Folks,
I have a text file that has only time in the format HH:MM:SS like seen below.
21:36:17
23:52:08
I need to find the difference in minutes alone from this text file so the result would be 136.
Thanks
Jay (11 Replies)
Discussion started by: jayadanabalan
11 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I need to subtract 5 minutes from the date. Example
$date +"%Y-%m-%d-%H.%M.%S" displays 2014-06-26-06.06.38
I want to show it as 2014-06-26-06.01.38 (5 mins are subtracted from date)
Any help would be appreciated. I am currently on AIX version 6.1
-Vrushank (10 Replies)
Discussion started by: vrupatel
10 Replies
4. Shell Programming and Scripting
Mar 26 15:25:11 : jdoe : TTY=pts/2 ; PWD=/home/jdoe ; USER=root ;
COMMAND=/usr/bin/su -
Mar 26 15:28:52 : jdoe : 3 incorrect password attempts ; TTY=pts/2 ;
PWD=/home/jdoe ; USER=root ; COMMAND=/usr/bin/su -
Mar 25 12:23:07 : jdoe : TTY=pts/2 ; PWD=/home/jdoe ; USER=root ;
... (6 Replies)
Discussion started by: Daniel Gate
6 Replies
5. Solaris
In Redhat it is easy....
date --date="60 minutes ago"
How do you do this in Solaris?
I got creative and got the epoch time but had problems..
EPOCHTIME=`truss date 2>&1 | grep "time()" | awk '{print $3 - 900}'`
echo $EPOCHTIME
TIME=`perl -e 'print scalar(localtime("$EPOCHTIME")),... (5 Replies)
Discussion started by: s ladd
5 Replies
6. 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
7. Shell Programming and Scripting
Hi
i want to print the time of a process in hours only..(or) in minutes only.Is there anyway to print the process such like that
when i give the commnand like following
#ps -eo pid,time
PID TIME
412 01:49:32
481 00:03
it shows in HH:MM:SS format:
Could anyone... (1 Reply)
Discussion started by: srikanthg
1 Replies
8. Shell Programming and Scripting
Hi All,
I want to find out the time before 30 minutes. I am able to do with in hours limit.
date
Fri Aug 21 06:50:00 BST 2009
TZ=CST+1 date
Fri Aug 21 04:50:02 CST 2009
Can any one please help me (6 Replies)
Discussion started by: vikash_k
6 Replies
9. Shell Programming and Scripting
Can some one help me getting last hour of the current time with date command in a script. (7 Replies)
Discussion started by: shehzad_m
7 Replies
10. Shell Programming and Scripting
Hi all,
may i know how to display time in minutes and seconds(may be milliseconds and even smaller that ) in shell scripts.... (1 Reply)
Discussion started by: santy
1 Replies