I've a simple shell script like
#!/bin/bash
sh -c "sleep 60" &
exec sleep 120
In using the pstree
command, I found something like
`-sleep(11681)---sleep(11682)
The first sleep is due to the sh -c
, so even I have execute that sleep in the background, it is now parented at my exec
's sleep.
Question: How to detach the first sleep and make the pstree
have something like
-sleep(11681)
-sleep(11682)