Exercise 3e: Using An External File
The queue command can read directly from an external file. If a file "argument.txt" is created and the commands will be passed to the executable from the contents of the txt file. The arguments.txt contains:
The script script.py reads and prints the arguments.
2 3 4 5 6 7
Create the following submit description file and submit the job.
#!/usr/bin/env python import sys for arg in sys.argv[1:]: print arg
HTCondor will put in the queue three jobs for the executable by giving different arguments each time. In the first job will pass 2 and 3 as arguments, in the second will pass 4 and 5 and in the third 6 and 7. The file arguments.txt is located in the current working directory. If it is somewhere else, the fully qualified name must be provided. A list of arguments can also be used, for example: ```Ini executable = script.py arguments = "$(argument)" output = output/$(ClusterId).$(ProcId).out error = error/$(ClusterId).$(ProcId).err log = log/$(ClusterID).log
executable = script.py output = output/$(ClusterId).$(ProcId).out error = error/$(ClusterId).$(ProcId).err log = log/$(ClusterID).log queue arguments from arguments.txt
queue argument in H2, H3, H4, H5 ```