Just writing a quick loop to list out existing tmux sessions when I log into a server, depending on whether tmux is installed (via .bashrc on CentOS).
if rpm -q tmux; then
echo -e "TMUX sessions running:\n"
echo `tmux ls`
fi
This works great when tmux has a session or two, but if there are no running tmux sessions, I'm getting failed to connect to server: No such file or directory
.
Is there a way to suppress this?
Thanks!