I want to write a bash script which opens new window in certain tmux session, runs another script in it and then closes.
The problem is, if I launch two instances of the script, I want the script to kill the previous instance (which has the same name).
If there is no window with this name, the script will not continue and will just throw an error:
can't find window windowname
How can I tell the script that I want to continue even if there is no window named 'windowname'?
tmux kill-window -t session:windowname
tmux new-window -t session -n "windowname" "/path/to/the/script.sh"
tmux kill-window -t session:windowname
I've tried "|| true", "|| :", "set +e", redirecting output to /dev/null, but none of them worked.
Recent Questions...
ما را در سایت Recent Questions دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 208
تاريخ: پنجشنبه
27 خرداد
1395 ساعت: 0:13