Another option: use a redirect to subshell. This changes the order in which background processes are started, so $! gives PID of the tail process.
tail -f $1 > >(nc -l -p 9977) &
wait $!
Another option: use a redirect to subshell. This changes the order in which background processes are started, so $! gives PID of the tail process.
tail -f $1 > >(nc -l -p 9977) &
wait $!