Suppose that I have the following simple bash script which I want to submit to a batch server through SLURM:
#!/bin/bash #SBATCH -o \"outFile\"$1\".txt\" #SBATC
If you pass your commands via the command line, you can actually bypass the issue of not being able to pass command line arguments in the batch script. So for instance, at the command line :
var1="my_error_file.txt" var2="my_output_file.txt" sbatch --error=$var1 --output=$var2 batch_script.sh