2
votes

I want to use parameters I've passed in to a PBS script in the PBS -N option. For example, when I run the PBS script:

#!/bin/bash
#PBS -N job_${num}

echo ${num}

with

qsub -v num=0 script.sh

It will start a job where the name is job_0.

With the above, a job with the name job_{num}. When I try using the line #PBS -N job_$num, I receive an error that the output files were not able to be created.

Is there a way to achieve what I'm looking for?

1

1 Answers

0
votes

The problem is that lines within a job script such as

#PBS -N job_${num} 

aren't resolved by the command line. The way to do what you're trying to do would be something like:

num=0; qsub -v num=$num -Njob_${num} script.sh

Where script.sh contains:

#!/bin/bash echo ${num}