2012-05-03 13 views
11

現在、私はiPadでGNUスクリーンを使用しており、接続が失われた場合の安全性としてスクリーンを利用しています。現在、私は最初のコマンドとしてscreen -S ipadを実行していますが、それが存在すれば自動的に古いipadセッションに接続する方法があります(そうでなければ作成します)?私の注意点は、1つのコマンドでこれを自動的に実行したいと思うことです。GNUスクリーン接続が存在する場合、作成しない場合は

答えて

20

-D -Rオプションを使用すると、画面が必要に応じて切り離しまたは作成を試みます。同様の結果と多くありますので、

screen -D -R -S ipad 

私は、あなたがスクリーン取扱説明書のすべての-d|D -r|-R|-RRオプションでご覧になることをお勧めします。

-d -r 
    Reattach a session and if necessary detach it first. 
-d -R 
    Reattach a session and if necessary detach or even create it first. 
-d -RR 
    Reattach a session and if necessary detach or create it. Use the first session if more than 
    one session is available. 
-D -r 
    Reattach a session. If necessary detach and logout remotely first. 
-D -R 
    Attach here and now. In detail this means: If a session is running, then reattach. If necessary 
    detach and logout remotely first. If it was not running create it and notify the user. This is 
    the author's favorite. 
-D -RR 
    Attach here and now. Whatever that means, just do it. 
    Note: It is always a good idea to check the status of your sessions by means of "screen -list". 
+0

パーフェクト!これはまさに私が探していたものでした。 – bswinnerton

関連する問題