next up previous contents
Next: Example 3 Up: Sample JDF Files Previous: Example 1   Contents

Example 2

The following example shows how the environment variable $FBS_PROC_NO can be used. In this example, the processes running on the farm will each process 1 file. Using $FBS_PROC_NO, we can write a script which makes sure that each user process processes a different file than the others. The script can take $n$ arguments, and inspect $FBS_PROC_NO to determine which file to process. The relevant code could look as simple as this:

   #!/bin/sh -f
   # Usage: process.sh <file1> <file2> <file3> ...
   # This script will use FBS_PROC_NO to choose which of the files
   # to process.
   
   # ...
   
   my_number=$FBS_PROC_NO 
   my_file=${$my_number}
   fbs msg "Processing $my_file"
   process.exe $my_file
   
   # ...

The EXEC field in the JDF file would have as it's arguments the names of the files to process and might look like this:


SECTION ProcessData
    NUMPROC = 3
    EXEC = bin/process.sh data_file_A data_file_B data_file_C
    ...



FBSNG Home