Here is one way of doing it. There are many:
#!/usr/bin/perl -w ####################################################### use strict; use warnings; use diagnostics; use FileHandle; my $fh=new FileHandle("< /var/run/mystamp.txt") or die "/var/run/mystamp.txt: $!"; my $stamp=<$fh>; chomp $stamp; undef $fh; $stamp += 86400; $fh=new FileHandle("> /var/run/mystamp.txt") or die "/var/run/mystamp.txt:$!"; printf $fh "%d\n",$stamp; undef $fh; exit(0);
That is an oversimplified IMHO way of doing it and let me outline some of the issues with this method:
What you didn't say in your post is why you are doing this in the first place. In your script that uses epoch time stamps why not use time system call to generate your epoch stamp?
| Peter L. Berghold -- Unix Professional Peter at Berghold dot Net | |
| Dog trainer, dog agility exhibitor, brewer of fine Belgian style ales. Happiness is a warm, tired, contented dog curled up at your side and a good Belgian ale in your chalice. | |
In reply to Re: Automate Parsing Script
by blue_cowdawg
in thread Automate Parsing Script
by vili
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |