I'm a big fan of the linux program "screen" which allows me to start a screen within a SSH session which can stay alive after I disconnect. More info about screen here
Is there a way I can start a screen session from a command line that automatically starts another program (or .sh script) within that screen session?
I'd like to add this to my raspberry pi's boot sequence so that there's always a screen running automatically running some software, even if the pi is restarted, so that I can ssh into the pi at any time to see that software's output.
I have looked at this solution, but this only helps partially. It starts screen like this
screen -t "df" watch -n 10 df
and successfully starts the "df" command.
However when the program is done running, the screen closes and disappears.
I would like the screen to stay alive even if the program originally started is finished.