2 |
## $Id$ |
## $Id$ |
3 |
## --------------------------------------------------------------------------- |
## --------------------------------------------------------------------------- |
4 |
## $Log$ |
## $Log$ |
5 |
|
## Revision 1.2 2003/01/20 21:19:27 joko |
6 |
|
## + updated 'sub now': knows about option 'fs' now |
7 |
|
## |
8 |
## Revision 1.1 2003/01/19 02:08:08 joko |
## Revision 1.1 2003/01/19 02:08:08 joko |
9 |
## + initial check-in |
## + initial check-in |
10 |
## |
## |
33 |
# see "perldoc -f localtime" |
# see "perldoc -f localtime" |
34 |
|
|
35 |
sub now { |
sub now { |
36 |
return strftime("%Y-%m-%d %H:%M:%S", localtime); |
my $options = shift; |
37 |
|
my $pattern = "%Y-%m-%d %H:%M:%S"; |
38 |
|
$pattern = "%Y-%m-%d_%H-%M-%S" if $options->{fs}; |
39 |
|
my $result = strftime($pattern, localtime); |
40 |
|
return $result; |
41 |
} |
} |
42 |
|
|
43 |
sub today { |
sub today { |
46 |
|
|
47 |
sub run_cmd { |
sub run_cmd { |
48 |
my $cmd = shift; |
my $cmd = shift; |
49 |
$cmd = 'perl ' . $cmd; |
my $caption = shift; |
50 |
|
#$cmd = 'perl ' . $cmd; |
51 |
my $sep = "-" x 90; |
my $sep = "-" x 90; |
52 |
print $sep, "\n"; |
print $sep, "\n"; |
53 |
print " ", $cmd, "\n"; |
print " ", $cmd, "\n"; |
54 |
|
print " ", $caption, "\n" if $caption; |
55 |
print $sep, "\n"; |
print $sep, "\n"; |
56 |
system($cmd); |
system($cmd); |
57 |
print "\n"; |
#`$cmd`; |
58 |
|
print "ready.", "\n"; |
59 |
} |
} |
60 |
|
|
61 |
sub run_cmds { |
sub run_cmds { |