2 |
## $Id$ |
## $Id$ |
3 |
## --------------------------------------------------------------------------- |
## --------------------------------------------------------------------------- |
4 |
## $Log$ |
## $Log$ |
5 |
|
## Revision 1.4 2003/02/22 17:19:36 joko |
6 |
|
## + unix compatibility fix |
7 |
|
## |
8 |
|
## Revision 1.3 2003/02/14 14:17:04 joko |
9 |
|
## - shortened seperator |
10 |
|
## |
11 |
|
## Revision 1.2 2003/02/11 05:14:28 joko |
12 |
|
## + refactored code from libp.pm |
13 |
|
## |
14 |
## Revision 1.1 2003/02/09 04:49:45 joko |
## Revision 1.1 2003/02/09 04:49:45 joko |
15 |
## + shortcuts now refactored to this file |
## + shortcuts now refactored to this file |
16 |
## |
## |
29 |
now today |
now today |
30 |
run_cmd run_cmds |
run_cmd run_cmds |
31 |
get_chomped |
get_chomped |
32 |
|
bool2status |
33 |
); |
); |
34 |
|
|
35 |
|
|
57 |
my $cmd = shift; |
my $cmd = shift; |
58 |
my $caption = shift; |
my $caption = shift; |
59 |
#$cmd = 'perl ' . $cmd; |
#$cmd = 'perl ' . $cmd; |
60 |
my $sep = "-" x 90; |
my $sep = "-" x 60; |
61 |
print $sep, "\n"; |
print $sep, "\n"; |
62 |
print " ", $cmd, "\n"; |
print " ", $cmd, "\n"; |
63 |
print " ", $caption, "\n" if $caption; |
print " ", $caption, "\n" if $caption; |
64 |
print $sep, "\n"; |
print $sep, "\n"; |
65 |
|
|
66 |
|
# fix for unix: prefix command with './' if no pathname (relative or absolute) included |
67 |
|
if (!RUNNING_IN_HELL()) { |
68 |
|
if ($cmd !~ m/\//) { |
69 |
|
$cmd = "./$cmd"; |
70 |
|
} |
71 |
|
} |
72 |
|
|
73 |
system($cmd); |
system($cmd); |
74 |
#`$cmd`; |
#`$cmd`; |
75 |
print "ready.", "\n"; |
print "ready.", "\n"; |
87 |
return $str; |
return $str; |
88 |
} |
} |
89 |
|
|
90 |
|
sub bool2status { |
91 |
|
my $bool = shift; |
92 |
|
return ($bool ? 'ok' : 'failed'); |
93 |
|
} |
94 |
|
|
95 |
|
sub RUNNING_IN_HELL () { $^O eq 'MSWin32' } |
96 |
|
|
97 |
|
|
98 |
1; |
1; |