나는 알아차렸다
tmux
변수는 세션 간에 공유됩니다.tmux
TMUX_PANE
새로운 세션도 추가됩니다.
VAR
각 세션마다 재설정이 가능한가요?
매 세션 TMUX_PANE
마다 시작할 수 있나요 ?0
# set variable
# create 2 sessions
$ export VAR=aaaaa
$ tmux new -A -s $VAR -d
$ export VAR=bbbbb
$ tmux new -A -s $VAR -d
$ tmux ls
aaaaa: 1 windows (created Fri Jan 23 12:12:46 2015) [207x50]
bbbbb: 1 windows (created Fri Jan 23 12:12:55 2015) [207x50]
# connect to sessions
# check value of variable
$ tmux att -t aaaaa
$ echo $VAR
aaaaa
$ tmux att -t bbbbb
$ echo $VAR
aaaaa <-------- i would like to see 'bbbbb' here
답변1
해결책을 찾았습니다.
옵션이 있는 다중 서버 -L
(소켓 이름 지정)
# set variable
# create 2 sessions
$ export VAR=aaaaa
$ tmux -L $VAR new -A -s $VAR -d
$ export VAR=bbbbb
$ tmux -L $VAR new -A -s $VAR -d
$ tmux ls
failed to connect to server
$ tmux -L aaaaa ls
aaaaa: 1 windows (created Fri Jan 23 12:12:46 2015) [207x50]
$ tmux -L bbbbb ls
bbbbb: 1 windows (created Fri Jan 23 12:12:55 2015) [207x50]
# connect to sessions
# check value of variable
$ tmux -L aaaaa att -t aaaaa
$ echo $VAR
aaaaa
$ tmux -L bbbbb att -t bbbbb
$ echo $VAR
bbbbb <-------- now i can see 'bbbbb' here