I have a script that takes a few seconds to complete. I would like to fork it into the
background, so that it continues to do its job, while allowing me to work with bash.
There are some workarounds such as forking in shell I guess, but I want to really
start the script, spawn a daemon, let it work there without me having to wait
on the commandline.
Now - there are some hints on the www but nothing that is really simple.
I guess what I need is some mini-daemon that does the job, while it allows
for me to continue to work with bash. Does anyone have some suggestions
or perhaps even has a script that does something like this?
Specifcally I would need the .rb file to output something, such as “forking
to background”, and then immediately allow me to continue to work with
bash after that message. I know how to use Thread.new() but this still
requires an actively running .rb file; I need something more like fork/spawn
or Process daemon but ideally something that is SUPER simple. Ideally
something I could copy paste in a minimal way, even better if I would
NOT have to depend on any external gem that does it for me - I really
want this to be purely standalone in that .rb file as much as possible.