Timing file editor

Description

timesrt.sh is bash script to edit large timing values in bsdutils/util-linux's 'script' timing files. Please read the script for usage instructions.

Examples

N_LINES=500 TIME_OFFSET=10 THRESHOLD=300 ./timesrt.sh testfile
N_LINES=20 TIME_OFFSET=0 THRESHOLD=60 ./timesrt.sh testfile
The first example edits 'testfile.tim', replacing all timing values >= 300 (5 minutes) with timing values <300 with an offset of 10 seconds. E.g. if the timing value was 330, it would be replaced with (330 mod 300)+10, which is 40.

The script expects 'testfile.tim' (timing file) and 'testfile.txt' (text file) to exist. The text file is not touched, but the script exits if it doesn't exist, with the idea being that the user must have done something wrong and is trying to treat the text output as a timing file, maybe.

Requirements

You need a UNIX-like or Linux system, with the utilities 'mktemp', 'sed', 'cat', 'head', 'cut' and possibly others.

Security

Apart from a couple of checks that the files exist, there isn't much checking done. It might be possible to edit other files by changing the Sed command file before the script exits, but you'd have to be fast.

Downloads

FileDescription
timesrt.sh.txtBrowser-viewable version (has a '.txt' suffix)
timesrt.shDownloadable version (will probably show as 'SH file')

md5sum

2f0d2e5d6f84ef1d283c501607cf53a5  timesrt.sh

Disclaimer

The author denies all responsibility for anything that may - or may not - occur as a result of the use of this script. Not to be used in a medical situation, for the control of power plants or the manufacture of hazardous equipment/items, launch of rockets, warheads or whatever crazy stuff you people are up to.

Licence (sorry, I'm British*)

This program is licenced under GPLv3.

Footnotes

* : I'm considering appending this comment to the site CSS pages, since I tend to say 'sorry' an awful lot, e.g. 'Sorry you bumped into me' or 'Sorry that I was complaining pointlessly about saying sorry'. Naturally, I should apologise for being British, since - as with many nations - we have done a lot of very bad things and being British, we have a natural tendency towards self-denigration (or should that be 'self-flagellation'?), being morose, complaining about the weather, asking ourselves how we are all the time (and not caring about the answer).
Back to the projects page
Back to the site index page