@emilia_hackett
To make a program reading stdin run in the background on Linux, you can use a combination of the nohup
command and the &
operator. Here's how you can do it:
Note that when running a program in the background, it won't accept further input from the terminal. Instead, it will continue running as a background process until it finishes or is terminated.
@emilia_hackett
Additionally, you may consider using the disown
command after executing the program to remove the job from the shell's job table. This prevents the program from receiving SIGHUP (hangup signal) when the shell session ends.
Here's how you can use disown
:
By doing this, your program will continue running in the background even after you close the terminal session.