2 |
## $Id$ |
## $Id$ |
3 |
## --------------------------------------------------------------------------- |
## --------------------------------------------------------------------------- |
4 |
## $Log$ |
## $Log$ |
5 |
|
## Revision 1.5 2003/02/22 17:26:13 joko |
6 |
|
## + enhanced unix compatibility fix |
7 |
|
## |
8 |
|
## Revision 1.4 2003/02/22 17:19:36 joko |
9 |
|
## + unix compatibility fix |
10 |
|
## |
11 |
|
## Revision 1.3 2003/02/14 14:17:04 joko |
12 |
|
## - shortened seperator |
13 |
|
## |
14 |
## Revision 1.2 2003/02/11 05:14:28 joko |
## Revision 1.2 2003/02/11 05:14:28 joko |
15 |
## + refactored code from libp.pm |
## + refactored code from libp.pm |
16 |
## |
## |
60 |
my $cmd = shift; |
my $cmd = shift; |
61 |
my $caption = shift; |
my $caption = shift; |
62 |
#$cmd = 'perl ' . $cmd; |
#$cmd = 'perl ' . $cmd; |
63 |
my $sep = "-" x 90; |
my $sep = "-" x 60; |
64 |
print $sep, "\n"; |
print $sep, "\n"; |
65 |
print " ", $cmd, "\n"; |
print " ", $cmd, "\n"; |
66 |
print " ", $caption, "\n" if $caption; |
print " ", $caption, "\n" if $caption; |
67 |
print $sep, "\n"; |
print $sep, "\n"; |
68 |
|
|
69 |
|
# strip name of executable from full command string |
70 |
|
$cmd =~ m/(.+?)\s/; |
71 |
|
my $executable = $1; |
72 |
|
|
73 |
|
# for unix: check if executable is in local directory, if so - prefix with './' |
74 |
|
if (!RUNNING_IN_HELL()) { |
75 |
|
#if ($cmd !~ m/\//) { |
76 |
|
if (-e $executable) { |
77 |
|
$cmd = "./$cmd"; |
78 |
|
} |
79 |
|
} |
80 |
|
|
81 |
system($cmd); |
system($cmd); |
82 |
#`$cmd`; |
#`$cmd`; |
83 |
print "ready.", "\n"; |
print "ready.", "\n"; |
100 |
return ($bool ? 'ok' : 'failed'); |
return ($bool ? 'ok' : 'failed'); |
101 |
} |
} |
102 |
|
|
103 |
|
sub RUNNING_IN_HELL () { $^O eq 'MSWin32' } |
104 |
|
|
105 |
|
|
106 |
1; |
1; |