I am running several dedicated servers on different tmux sessions.
I have to change ports and have to write a command in all the tmux sessions.
The command is: config['Port'] = 12345, 12345 being the port.
I tried to write a script which would take inputs from me and type the whole code with the code I input into all the different tmux sessions, but it doesn't work. The name of the session is 43210.
#!/bin/bash
read -p '43210: ' avar
tmux attach-session -t 43210 "config['Port'] = ${avar}"
But it never works and shows:
usage: attach-session [-dr] [-t target-session]