1

I have successfully installed Torque PBS on my ubuntu server. Job submission is fine. However there is an annoying thing. I found bash environment is not right inside PBS

for example

echo 'echo $PATH > ~/res.txt' | qsub

and the content of res.txt is

/home/admin-pc/bin:/home/admin-pc/.local/bin:/bin:/usr/bin:/snap/bin

This is definitely not what my PATH is.

So I tried

echo 'source ~/.bashrc;echo $PATH > ~/res.txt' | qsub

This doesn't work. It just output the same PATH

So I was wondering, maybe ~/.bashrc is not the same inside PBS. So I tried

echo 'cat ~/.bashrc > ~/res.txt' | qsub

But the content of res.txt is exactly what my ~/.bashrc is.

This is really odd to me.

The only workaround I found is to use bash -ic

echo "bash -ic 'echo \$PATH > ~/res.txt'"|qsub

But this is so awkward. Is there any better way to make PBS automatic inherit bash environment?

user15964
  • 121
  • 5

0 Answers0