I write a bash file, which contains screen commands. This bash file is then called from a python script using subprocess. All works perfectly fine. However, the screen sessions don't close after the script has (successfully) run and stay open. This is unwanted behaviour.
Here is an example of the bash file:
#!/bin/bash VIRTUAL_ENV_DISABLE_PROMPT=true source generic_path/bin/activate cd generic_directory screen -dmS session_1 screen -S session_1 -X stuff "Rscript script_1.R\n"
I suspect, that I have to change something in the screen commands, right? Could you advise, what I have to change, so the screen session automatically close, after the script has run.