tmuxの最初のセッションウィンドウを利用する方法

tmuxの最初のセッションウィンドウを利用する方法

次のスクリプトを使用して作成されたセッションfigletの最初のウィンドウで使用したいと思います。tmux

 #!/bin/bash

 # log the date time in a log file
 date >> ~/logFiles/session.log

 # start a session called TWIN
 /usr/bin/tmux new-session -d -s TWIN

 # stay on even when the script crashes
 /usr/bin/tmux set-option set-remain-on-exit-on

 # Start the python script
 /usr/bin/tmux new-window -d -n 'bucket' -t TWIN:1 'sleep 20; 
                                             sudo /home/pi/bin/bucket.py'

 # Start checker script in the folder
 /usr/bin/tmux new-window -d -n 'checker' -t TWIN:2 'cd /home/pi/incoming; 
                                                     figlet Incoming;
                                               /home/pi/incoming/checker'

 # Start the Bootstraploader script
/usr/bin/tmux new-window -d -n 'bsl' -t TWIN:3 'cd /home/pi/bsl; 
                                         figlet BootStrapLoader;
                                               /home/pi/bin/bsl'

exit 0

上記のスクリプトは、次のWindowsを生成します。

0:sh | 1: bucket | 2: checker| 3: bsl

このfiglet手紙はうまくいきますwindow:2が、追加しwindow:3たいです。figlet0:sh

次の行を追加してみました。

/usr/bin/tmux new-window -d -n 'welcome' -t TWIN:0 'figlet hello'

上記のスクリプトでは、出力は次のようになります。

  ./createSession 
  unknown option: set-remain-on-exit-on
  create window failed: index in use: 0

また、以下を試しました。

 /usr/bin/tmux new-session -d -s TWIN 'figlet hello'

ただし、出力は次のようになります。

 can't establish current session

0:sh生成コマンドによって生成されたものを何とか使用したいと思いますnew-session

これを使う方法はありますか?ログインセッションを使用するたびに空のtmux aセッションが表示されますが、そうではありません。クール

メモ:

このようにfiglet Incoming見えました(お使いの方のために)


 ___                           _             
|_ _|_ __   ___ ___  _ __ ___ (_)_ __   __ _ 
 | || '_ \ / __/ _ \| '_ ` _ \| | '_ \ / _` |
 | || | | | (_| (_) | | | | | | | | | | (_| |
|___|_| |_|\___\___/|_| |_| |_|_|_| |_|\__, |
                                       |___/ 

ベストアンサー1

おすすめ記事