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

In RVM (Ruby Version Manager) you can create .rvmrc files for a per-project basis. This handles basic ruby version and library (gem) management. This script is automatically executed when you cd into an directory. However, it is nothing more than a Bash script. There is one particular part in the script that is as follows:

  if ! command -v bundle ; then
    gem install bundler --no-rdoc --no-ri

  bundle | grep -v 'Using' | grep -v 'complete' | sed '/^$/d'

) &

Since this is executed ever time you cd into a directory, it would be nice if I didn't get the following every time:

[1]+  Done                    ( if ! command -v bundle; then
    gem install bundler --no-rdoc --no-ri;
fi; bundle | grep --color=auto -v 'Using' | grep --color=auto -v 'complete' | sed '/^$/d' )

Is there any way that I can run these set of commands in the background and not be notified when it is completed. Or at least notified in a less obnoxious way such that the message might be like:

[1]+ Bundler is done! :-)


share|improve this question
up vote 2 down vote accepted

Try using disown, for example:

sleep 1 & disown

From man bash:

disown [-ar] [-h] [jobspec ...]

Without options, each jobspec is removed from the table of active jobs. If jobspec is not present, and neither -a nor -r is supplied, the shell's notion of the current job is used. If the -h option is given, each jobspec is not removed from the table, but is marked so that SIGHUP is not sent to the job if the shell receives a SIGHUP. If no jobspec is present, and neither the -a nor the -r option is supplied, the current job is used. If no jobspec is supplied, the -a option means to remove or mark all jobs; the -r option without a jobspec argument restricts operation to running jobs. The return value is 0 unless a jobspec does not specify a valid job.

share|improve this answer
Works great! The only issues is that it shows me the command it is disowning. Not a big deal but, I'd like to hide that too if possible. :-) – John Jan 12 '12 at 21:17
(sleep 1 & disown) 2>/dev/null – choroba Jan 12 '12 at 21:45

You can redirect all output to either a logfile or to /dev/null too. Simply change the last line from

) &


) 2>&1 >>/var/log/rvm-log &
share|improve this answer

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.