Exercise 5c: Running Multiple Scripts
If more than one Pre script is to be run before the executable, it needs to be defined in the submit file:
Create exercise5c.sub using the following:
executable = welcome.sh
output = output/ex_05.$(ClusterId).$(ProcId).out
error = error/ex_05.$(ClusterId).$(ProcId).err
log = log/ex_05.$(ClusterId).log
transfer_input_files = your_path/file01.sh, your_path/file02.sh
+PreCmd = "file01.sh"
queue
+PreCmd = "file02.sh"
queue
The script file01.sh contains :
#!/bin/bash
echo "Hello! I am exercise number 5 "> exercise05-01.txt
#!/bin/bash
echo "Hello! I am exercise number 5 "> exercise05-02.txt
Note: Two different Pre scripts can not be defined as:
+PreCmd = "file01.sh", "file02.sh"
The following will also fail:
+PreCmd = "file01.sh"
+PreCmd = "file02.sh"
queue
Last update: November 26, 2019