2016-05-14 4 views
2

私はbashに新たなんだと、以下のスクリプトをやっているかを理解しようとしているが、私は-eが終了している知っているが、私は何-seまたは何$delimiterがためにあるかわかりませんか? man bashからbash -sとは何ですか?

$delimiter = 'EOF-MY-APP'; 

$process = new SSH(
    "ssh $target 'bash -se' << \\$delimiter".PHP_EOL 
     .'set -e'.PHP_EOL 
     .$command.PHP_EOL 
     .$delimiter 
); 
+0

'。 http://linux.die.net/man/1/bash(出典:10秒間のGoogle検索) –

+1

^^したがって、 '-s'は重複していますか?誰でも '-s'が必要な例を提供できますか? – anishsane

+0

Stack Overflowは、プログラミングおよび開発に関する質問のサイトです。この質問は、プログラミングや開発に関するものではないので、話題にはならないようです。ヘルプセンターの[ここではどのトピックを参照できますか](http://stackoverflow.com/help/on-topic)を参照してください。おそらく、[スーパーユーザ](http://superuser.com/)や[Unix&Linux Stack Exchange](http://unix.stackexchange.com/)の方が良いかもしれません。 – jww

答えて

4

help setから
-s If the -s option is present, or if no arguments remain after 
    option processing, then commands are read from the standard 
    input. This option allows the positional parameters to be 
    set when invoking an interactive shell. 

-e Exit immediately if a command exits with a non-zero status. 

だから、これはStandaから実行するスクリプトを読み込むためにはbashに指示しますrd入力し、スクリプト内のコマンド(stdinから)が失敗するとすぐに終了します。

区切り記号は、スクリプトの開始と終了を示すために使用します。これはHere Documentまたはヘレドックと呼ばれます。標準入力からコマンドを読み込み-s`

+0

ザ・引用部分が不完全になります:(この場合 – sjsam

+1

スクリプトへの引数がないので、 '-s'オプションは、冗長である。' man'/'help'私のMac上でコマンドを実行しているから来た – Barmar

+1

@sjsamを。 – Will

関連する問題