I have a shell script that will sometimes be run from the terminal.
When it is run from the terminal, it needs to find out whether a certain PID is running in the background or in the foreground.
With GNU procps's ps that's easy because foreground processes have a + in the status column.
Alas, BusyBox's ps has a status column but does not provide this information (it does not have the handy + symbol).
Do any of you smart TCL folks know how to determine whether a PID is running in the foreground or background, using only BusyBox tools?