Sponsored Content
Full Discussion: Check data and time
Top Forums Shell Programming and Scripting Check data and time Post 302361558 by danmero on Tuesday 13th of October 2009 01:44:42 PM
Old 10-13-2009
Code:
#!/bin/sh
DATE=`date +%u%H%M`
[ $DATE -gt 6515 -a $DATE -lt 6650 ] && exit 0;
......
# Do something else ...

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to get data between the start time and end time?

Hi, Can anyone help me how can I get the line that between the start time and end time. file1.txt 15/03/2009 20:45:03 Request: - Data of this line 15/03/2009 20:45:12 Response: - Data of this line 15/03/2009 22:10:40 Request: - Data of this line 15/03/2009 22:10:42 Response: - Data of... (1 Reply)
Discussion started by: tanit
1 Replies

2. Shell Programming and Scripting

Check Time/Date on a server

I have two servers which are not in sync. I need to write a script that checks the time on the corresponding server and another script to call the above script on both the servers simulataneously to check if there is a time difference. Can anyone provide me with such scripts as I am new to... (3 Replies)
Discussion started by: ravneet123
3 Replies

3. UNIX for Dummies Questions & Answers

Check time and Increase counter

Hi all... the last two weeks have been very educational... I went through a bunch of websites about linux and its commands.. still not have mastered it nor its many operators ... and symbols. I wish I had more time to dig to the next and unix.com but I m on a deadline for this project. I... (2 Replies)
Discussion started by: abilash.amara
2 Replies

4. UNIX for Dummies Questions & Answers

Time check!

How can i do something, that will be doing periodicaly for 24 hours and then do something else. For example: i want to write "time" in a text file every 10 sec but only for the next 24 h and then rewrite all that data to an other file, then again write "time" in the first file every 10 sec,... (5 Replies)
Discussion started by: petel1
5 Replies

5. Shell Programming and Scripting

Check file time stamp

Hi, I need help to read file in a directory on basis of time stamp. e.g. If file access in last 2 minutes it should not be copy to remote directory. Below is my script. #!/bin/ksh DATE=`date +"%Y-%m-%d_%H%M"` SEPARATER=" " exec < out_interfaces.cfg while read source_path... (10 Replies)
Discussion started by: qamar.alam
10 Replies

6. Shell Programming and Scripting

how to check whether a process started at particular time

I want to check whether a particular process has started at 10:00a.m or not. I can check process by ps -fu but dont know how to check it with respect to time. Could anyone help me with this? ---------- Post updated at 11:14 AM ---------- Previous update was at 10:52 AM ---------- can i use... (9 Replies)
Discussion started by: kishore kumar
9 Replies

7. Shell Programming and Scripting

IF loop to check the time modified

Hi Frnds, i have a folder test in which files generated daily how to chek the files that are modified on that day as a condition for ex, if then echo "i have got something to do with the file" else echo" sorry" fi i will have more than 3 to 4 files that are modified today. and if... (5 Replies)
Discussion started by: mahesh300182
5 Replies

8. Programming

Find gaps in time data and replace missing time value and column 2 value by interpolation in awk

Dear all, I am kindly seeking assistance on the following issue. I am working with data that is sampled every 0.05 hours (that is 3 minutes intervals) here is a sample data from the file 5.00000 15.5030 5.05000 15.6680 5.10000 16.0100 5.15000 16.3450 5.20000 16.7120 5.25000... (4 Replies)
Discussion started by: malandisa
4 Replies

9. Shell Programming and Scripting

Check if time format is valid

How can I validate if time (HH:MM:SS) argument is valid? I got this from web but I can't modify it to exit the script if the time argument is invalid. echo $1 | awk -F ':' '{ print ($1 <= 23 && $2 <= 59 && $3 <= 59) ? "good" : "bad" }' ex: ./script.ksh 12:34:21 = okay ./script.ksh... (10 Replies)
Discussion started by: erin00
10 Replies
script(1)							   User Commands							 script(1)

NAME
script - make record of a terminal session SYNOPSIS
script [-a] [filename] DESCRIPTION
The script utility makes a record of everything printed on your screen. The record is written to filename. If no file name is given, the record is saved in the file typescript. See WARNINGS. The script command forks and creates a sub-shell, according to the value of $SHELL, and records the text from this session. The script ends when the forked shell exits or when Control-d is typed. OPTIONS
The following option is supported: -a Appends the session record to filename, rather than overwriting it. NOTES
script places everything that appears on the screen in filename, including prompts. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) WARNINGS
script can pose a security risk when used in directories that are writable by other users (for example, /tmp), especially when run by a privileged user, that is, root. Be sure that typescript is not a link before running script. SunOS 5.11 30 Jan 2004 script(1)
All times are GMT -4. The time now is 11:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy