Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Sometimes I start several processes by using another script (in my case Ruby). I call this script from a terminal running bash. I would like to start those processes in the script in the background (by using &). Unfortunately those processes are not listed when calling jobs from within the terminal that run the script. I guess because those are run in a sub shell. This makes it hard to manage them.

Is there a way so that those processes are available by using jobs in the parent shell?

share|improve this question
I wonder if ptree $$ would show you ruby's jobs from the parent shell. – glenn jackman Apr 25 '11 at 20:20
ptree does not seem to be available on my system. Ubuntu recommends me to install adacontrol. – Zardoz Apr 25 '11 at 20:28
up vote 1 down vote accepted

The only way is for the jobs themselves to be started in the parent shell.

At the moment you have:

shell -> ruby -> shell -> command

If you could have the commands in a shell script, and not ruby, you could execute that shell script in the current shell with

$ source

or short-hand:

$ .

Then any programs started in the background in that script should be in jobs in the current shell.

share|improve this answer
Bye bye ruby ... hello bash programming ... brrrrrr ;-) – Zardoz Apr 25 '11 at 19:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.