最も簡単な方法は、リモート シェルに参加することだと思います。パラメータerl
から始めるだけです-remsh Node
$ erl -sname foo
Erlang R13B04 (erts-5.7.5) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.7.5 (abort with ^G)
(foo@hynek-notebook)1>
別の端末:
$ erl -sname bar -remsh 'foo@hynek-notebook'
Erlang R13B04 (erts-5.7.5) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.7.5 (abort with ^G)
(foo@hynek-notebook)1>
別のオプションは、erl
( を押す^G
)の強力なジョブ制御機能を使用することです
$ erl -sname bar
Erlang R13B04 (erts-5.7.5) [source] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.7.5 (abort with ^G)
(bar@hynek-notebook)1>
User switch command
--> h
c [nn] - connect to job
i [nn] - interrupt job
k [nn] - kill job
j - list all jobs
s [shell] - start local shell
r [node [shell]] - start remote shell
q - quit erlang
? | h - this message
--> r 'foo@hynek-notebook'
--> j
1 {shell,start,[init]}
2* {'foo@hynek-notebook',shell,start,[]}
--> c
Eshell V5.7.5 (abort with ^G)
(foo@hynek-notebook)1>
User switch command
--> j
1 {shell,start,[init]}
2* {'foo@hynek-notebook',shell,start,[]}
--> c 1
(bar@hynek-notebook)1>
Enter
既存のシェル プロンプトに戻す場合は、を押してシェル プロンプトを表示する必要があることに注意してください。