I would like to record the PID of a process when i lauch it from my script
something like:
#/bin/bash
$abc_pid = /apps/abc/abc.bin -port6700
I know I can run the ps command and grep for abc.bin. The idea is that becase the process runs on several ports and the argument list of .bin is quite large, it would be easier if I could capture the PID at run time.
I've tried $abc_pid = $! but this does not work. Also, I've read that sometimes that can give a forked PID instead of the parent.
Thanks,