It seems that I cannot use
qsub as in
qsub -q hpc-pool ./myScript.sh
myScript.sh contains several
./ somewhat is translated to
~/. Why is this the case?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Batch jobs submitted by
qsub are executed in your home directory by default.
Some versions of
qsub support the
-d option to specify a different directory. To execute the script in the same directory where you ran
qsub -d "$PWD" -q hpc-pool ./myScript.sh
-d option is not available, you can access the directory where you ran
qsub in your script, in the
PBS_O_WORKDIR variable. So add this line near the beginning of your script:
cd "$PBS_O_WORKDIR" || exit $?