I'm running the following as root:
Code:
$ su username --command "somecommand --someSwitch"
The "somecommand" puts itself into the background to run, then the shell exits. I'd like to know what the pid of this command is so I can following it with `ps` or `kill -0 pid`. I've tried
Code:
$ su username --command "somecommand --someSwitch; echo $! >/tmp/thePID"
but that doesn't work. Ideas?