/[cvs]/nfo/perl/libs/org/netfrag/shortcuts.pm
ViewVC logotype

Diff of /nfo/perl/libs/org/netfrag/shortcuts.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by joko, Sun Jan 19 02:08:08 2003 UTC revision 1.2 by joko, Mon Jan 20 21:19:27 2003 UTC
# Line 2  Line 2 
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  ##  ##
# Line 30  use POSIX qw(strftime); Line 33  use POSIX qw(strftime);
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 {
# Line 39  sub today { Line 46  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 {

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed