In bash, I know that if I run:
my_executable arg1 arg2 &
I've started a background job; and I'll also get its id and pid printed on the console, e.g.:
[1] 25103
but how do I place those numbers in variables? This doesn't work:
my_executable arg1 arg2 & | read jid_in_brackets pid
... it's a syntax error.