0

Say I want to schedule this job to be run at later time

MYPROGRAM > output.out 2> error.err | at 02:00 PM Mon

How can I attain its PID? Surely using:

echo $!

will not work?

  • Can you elaborate a little? You can't get the pid until the program runs, is MYPROGRAM trying to get its own pid for some purpose? (And is it a shell script, otherwise, $! won't mean anything to it?) – Ulrich Schwarz Jan 23 '16 at 17:53
2

You can't get a PID of a process which is not currently running, so there is no meaning for PID of a scheduled job.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.