I use a script which after execution opens different tabs and connects to different servers(using ssh). Now along with that,I want to run another command (say 'pwd').So how to do that?
gnome-terminal --tab -e 'ssh user@ip1' --tab -e 'ssh user@ip2'
using ansible you only need to do somthing like this
ansible <your-list-of machine> -m shell -a "your command"
ansible ip1 -m shell -a "echo $TERM"