linux - How can I launch multiple xterm windows and run a command on each, leaving each window open afterward? -


i'm lazy, , prefer computers work me. ssh several machines on daily basis, created simple script launches xterm windows , places them in positions want (as can see, i'm using bash):

#!/bin/bash xterm -geometry 80x27+1930+0 & xterm -geometry 80x27+2753+0 & xterm -geometry 80x27+1930+626 & xterm -geometry 80x27+2753+626 & 

however, next thing go first window , type in

ssh server_a 

then in second

ssh server_b 

and on. i'd have script ssh commands in each xterm window, , leave windows open me work. i've seen -e option xterm, window closes after execute command. there way this?

i apologize if duplicate question. i've searched around , haven't had luck this. many thanks!

i'd love see more elegant answer, came work:

xterm -e bash -c 'echo foo; exec bash' 

replace echo foo command of choice, , you're go.


Comments