Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I find I frequently use the combination of Suspend (^Z) then send to background (bg) in bash. Ideally I would like an alternate keyboard shortcut that negates the need to follow ^Z with the bg command, and just send the active process straight to background. Does this exist?

Edit: I should have been more specific, but appending & to the command is not sufficient, as they often require interaction (stdin) between launch and backgrounding. So:

  1. launch
  2. interact
  3. background
share|improve this question

migrated from Nov 23 '11 at 9:38

This question came from our site for professional and enthusiast programmers.

Simply use the & char at the end of a line:

anycommand &
share|improve this answer

add an & at the end of the command

share|improve this answer

Since you require interaction with your script immediately after launching it, consider (if you can) enumerating the responses you will require in a file first (one response per line). Then, launch your script and redirect its STDIN from the response file.

share|improve this answer
Just be careful since, if the script tries to read from its standard input in this scenario past your "expected" inputs, it will get an EOF (and likely fail somehow, more or less gracefully, because of it). – Michael Kjörling Nov 23 '11 at 10:11

You must log in to answer this question.