Bash: capturing PID of background-started process

Running some_process in background and capturing its PID to file to kill later on:

some_process & echo $! > output_file_name

This one is even better...

A=`some_process > /dev/null & echo $!`
sleep 10
kill -9 $A