Skip to content

Exercise 2d: Standard Input within a Job

For executables requiring standard input, HTCondor provides an option to specify the input file to pipe into the executable.

We can adjust the script as follows in order to demonstrate this functionality:

for i in {1..3}; do
  echo "Enter input $i: "
  read input
  echo "You have entered: $input"
We can set the input.txt file to contain the following:
Finally, the submission script can be defined as shown below:
executable              =
input                   = input.txt
output                  = out.$(ClusterId).$(ProcId)
error                   = err.$(ClusterId).$(ProcId)
log                     = log.$(ClusterId).$(ProcId)
Execute condor_submit to submit the job. When the job has finished running, you can check that the following output was generated:
Enter input 1: 
You have entered: apples
Enter input 2: 
You have entered: oranges
Enter input 3: 
You have entered: avocado

Last update: November 26, 2019