Process status for NOHUP command

Hi,

I have run a shell script as a background process using 'nohup' command. I want to see the process id of this, so that I will be able to kill it later on when required.

I tried to collect these details using 'ps' command and could not view this information.

How do we get this details, please help.

Thank you.

Refer here

Hi,

The below link is not quite helpful for me and I'm using bash shell, please give me more relevant examples and which is easier to understand.

Thank you.

The example given in the referenced thread is relevant, as it tells you a way to get the PID of a background nohup process. And bash and ksh are largely (though not completely) compatible.

Hi,

I could not get any output, when I use the Print command. It throws an error. Please help, thank you.

Test> print $$ > .pid
-bash: print: command not found

That would be one of the few cases where ksh and bash aren't compatible, as ksh has a built-in print command, while bash doesn't. Use echo or printf instead.