cleaner way to rename windows

This commit is contained in:
n 2015-09-10 22:02:26 +02:00
parent f8cc3527d9
commit 79286bacb8

View file

@ -15,15 +15,15 @@ then
exit 1 exit 1
fi fi
# main screen (physical host)
screen -d -m -S $session -t `hostname -s`
screen -d -m -S $session # servers' screens : open a ssh connexion from the host to them, then rename it
screen -S $session -p $window -X exec printf "\033k%s\033\\" `hostname -s`
for server in $servers for server in $servers
do do
let window++ window=$(( window + 1 ))
screen -S $session -X screen ssh $server screen -S $session -X screen ssh $server
screen -S $session -p $window -X exec printf "\033k%s\033\\" $server screen -S $session -p $window -X title $server
done done
screen -r $session -p 0 screen -r $session -p 0