I am new to shell scripting (you can say I'm just starting). I need to write a shell script to open ONLY 1 βscreenβ session. Then I want to open several windows (for example, 10) in one session and each session should do something, for example, type "hello". So, here is part of my code, but it creates only one window (0) and does not print anything in this window:
#!/bin/bash screen-d -m -S mysession for n in {1..10}; do i=$(($n-1)) screen -S mysession -p $i -X echo "hello" done
As I said, my sample code does not work! It opens one session with only one window "0", and nothing is printed on the terminal in the window "0".
could you help me? The code should open one screen session, and then in a cycle open 10 windows and type βhelloβ in each window.
Thank you in advance!
Abedin
bash shell gnu-screen
user3578925
source share