PBS Environment Variables
PBS sets multiple environment variables at submission time. The following PBS variables are commonly used in batch scripts:
- PBS_O_WORKDIR
- PBS sets the environment variable
PBS_O_WORKDIRto the directory where the batch job was submitted. - By default, a job starts in your home directory.
- Include the following command in your script if you want it to start in the submission directory:
- PBS sets the environment variable
cd $PBS_O_WORKDIR
- PBS_JOBID
- PBS sets the environment variable
PBS_JOBIDto the job’s ID. - A common use for
PBS_JOBIDis to append the job’s ID to the standard output and error file(s), such as the following:
- PBS sets the environment variable
#PBS -o scriptname.o$PBS_JOBID
