Start the long-running report.sh from an interactive shell and immediately regain the prompt.
Which input is appropriate?
Appending & starts the command as a background shell job and returns the prompt.
Detailed explanation
./report.sh &Correct. ./report.sh & starts the command in the background.
./report.sh |Incorrect. A pipe requires a command on the right side.
./report.sh >Incorrect. A redirection operator requires a destination.
./report.sh &&Incorrect. && waits for the first command to succeed before running another.
Try it yourself
An example you can run in a temporary verification environment.
sleep 0.1 & waitExpected result
短命background processを待って正常終了Key points
- &
- Background job
- Shell prompt
Notes
- Environment: Bash 5.x
- Use a disposable process or test shell when checking lifecycle commands.
- Exact output and option names can vary slightly by distribution and tool version.
Foundation review
Place the operation
An ampersand changes shell job control; it does not by itself redirect output or create a process supervisor.
Check the side effect
Remember that background output can still reach the terminal unless a redirection is added.