Changeset 77 for trunk/oarutils
- Timestamp:
- May 30, 2012, 1:59:59 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oarutils/oar-parexec
r76 r77 75 75 my $job_num = 0; 76 76 open(JOB_LIST, '<', "$file") or die "error: can't open job file $file: $!"; 77 while ( <JOB_LIST>) {78 chomp ;79 next if m/^#/;80 next if m/^\s*$/;77 while (my $job_cmd = <JOB_LIST>) { 78 chomp $job_cmd; 79 next if $job_cmd =~ m/^#/; 80 next if $job_cmd =~ m/^\s*$/; 81 81 $job_num++; 82 push @job, { name => $job_num, cmd => "$_" }; 82 my ($job_name) = $job_cmd =~ m/#.*?\bname=(\S+?)\b/i; 83 $job_name ||= $job_num; 84 push @job, { name => $job_name, cmd => "$job_cmd" }; 83 85 } 84 86 close JOB_LIST; … … 327 329 the first valid job in the list will have the number 1 and so on... 328 330 331 It's possible to fix the name inside a comment on the job line. 332 For example: 333 334 $HOME/test/subjob1.sh # name=subjob1 335 336 The key C<name> is case insensitive, 337 the associated value cannot have a space... 338 329 339 =item B<-d|--dir foldertoiterate> 330 340 … … 414 424 Example where F<$HOME/test/subjob1.sh> is a shell script (executable). 415 425 416 $HOME/test/subjob 1.sh417 $HOME/test/subjob 2.sh418 $HOME/test/subjob 3.sh419 $HOME/test/subjob 4.sh426 $HOME/test/subjob01.sh # name=subjob01 427 $HOME/test/subjob02.sh # name=subjob02 428 $HOME/test/subjob03.sh # name=subjob03 429 $HOME/test/subjob04.sh # name=subjob04 420 430 ... 421 $HOME/test/subjob38.sh 422 $HOME/test/subjob39.sh 423 $HOME/test/subjob40.sh 431 $HOME/test/subjob38.sh # name=subjob38 432 $HOME/test/subjob39.sh # name=subjob39 433 $HOME/test/subjob40.sh # name=subjob40 424 434 425 435 These jobs could be launch by:
Note: See TracChangeset
for help on using the changeset viewer.