Was wondering how I can start up a command such as:
while :; do ./myCommand; done;
But instead of doing the usual
screen -S nameOfMyScreen
Then the command
while :; do ./myCommand; done;
Then detach the screen
^a ^d (Control "a" the control "d"
I would like it to start and detach. Thanks!
Explanation:
-d -mstarts screen in detached mode (create session but don’t attach to it)sh -c commandlinestarts a shell which executes the given command line (necessary, since you are using thewhilebuiltin).