This is what I'm running:
alexandma@ALEXANDMA-1-MBP ./command.sh &
[2] 30374
alexandma@ALEXANDMA-1-MBP
[2] + suspended (tty output) ./command.sh
I don't want it to start suspended, I want it to keep running in the background. I'm going to be running a bunch of these in a loop, so I need something that will work that way.
How can I keep it running?
Best Answer
It stops because of the reason given: it tries to output to tty. You can try to redirect the output if
./command.sh
supports that, or run the command in atmux
orscreen
window of it's own. E.g.and then view the list of windows created with
tmux list-windows
and attach totmux
withtmux attach
.That way the program will still wait for input/output to happen, but you can easily provide input once you go to the appropriate window and the output will just be captured without any activity.