Sample Header Ad - 728x90

Execute command when creating new screen session

1 vote
1 answer
996 views
With the screen command, the -X option allows you to execute a command in the specified screen session, but when you try to use it when creating a *new* screen, e.g:
screen -dmS -S downloader -X "wget https://google.com "
you get the error No screen session found.. So it's clear the the -X option only works for pre-existing screen sessions. Is it possible to specify a command to be run on the creation of a *new screen*? If it's not possible in screen, is it possible in another multiplexer like tmux?
Asked by pigeonburger (179 rep)
Aug 23, 2021, 11:41 PM
Last activity: Aug 23, 2021, 11:48 PM