Thread Starten von Programmen nach Erstellung eines Files (14 answers)
Opened by giordani at 2010-07-07 11:12

Linuxer
 2010-07-07 13:16
#139638 #139638
User since
2006-01-27
3881 Artikel
HausmeisterIn

user image
Legt sich das zweite Kommandos automatisch in den Hintergrund?
Wenn nicht, dann brauchst Du nicht extra warten; erst wenn das von system() aufgerufene Kommando fertig ist, wird das Programm weiter ausgeführt.

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use warnings;
use File::Spec::Functions qw( catdir catfile );

# Arbeitsverzeichnis, wo die Programme liegen
my $dir = 'E:/Benutzer/06simulation/proc';

# stelle die notwendigen Kommandos in einem Hash zusammen;
# Pfade werden mit catfile zusammengebaut; http://search.cpan.org/perldoc?File::Spec::Functions
my %cmd = (
  init    => catfile( $dir, "01runInitElthetaBatchScript.ahk" ),
  batch   => catfile( $dir, "02runBatchScript.ahk"            ),
  analyze => catfile( $dir, "03procInitElthetaOut.pl"         ),
);

# Fuehre Kommandos einzeln aus; prüfe Erfolg; sterbe bei Misserfolg
system( $cmd{init}    ) == 0 or die "execution of "$cmd{init}" failed: $!\n";
system( $cmd{batch}   ) == 0 or die "execution of "$cmd{batch}" failed: $!\n";
system( $cmd{analyze} ) == 0 or die "execution of "$cmd{analyze}" failed: $!\n";


__END__

meine Beiträge: I.d.R. alle Angaben ohne Gewähr und auf Linux abgestimmt!
Die Sprache heisst Perl, nicht PERL. - Bitte Crossposts als solche kenntlich machen!

View full thread Starten von Programmen nach Erstellung eines Files