I'm currently trying to run a command in a detached gnu screen from bash, but simply using
screen -r myscreen
mycommand
doesn't work. Detaching from the screen after executing the command isn't necessary since the command is used to gracefully exit the program.
I also tried using
{
mycommand
} | sudo screen -r myscreen
like answered on the post Bash Script commands inside a program, but this returned Must be connected to a terminal
, along with a command not found error.
Is there a way to execute a command in a gnu screen from bash?