By default, output from a submitted job to a Torque queue will be saved to a file named like job_name.o658392
. What I want to do, using that example, is to name the output file 658392.job_name.log
instead.
I know I can specify the name of the output file by writing the line #PBS -e filename
at the top of my script, and it is even possible to use variables such as $PBS_JOBID
in the filename.
The problem is that $PBS_JOBID
is not just the number - instead it looks like 658392.some.very.long.host.name
.
I've tried using ${PBS_JOBID/.*}
, which should refer only to the numbers, but the problem is that I get an error doing this. It reads: Failed to expand destination path in data staging: /path/to/output/${PBS_JOBID/.*}.log
Do you know how to specify the output file name in a way that works?