るりまサーチ

最速Rubyリファレンスマニュアル検索!
315件ヒット [201-300件を表示] (0.028秒)

別のキーワード

  1. _builtin spawn
  2. pty spawn
  3. kernel spawn
  4. etc sc_spawn
  5. process spawn

クラス

  • IO (154)

モジュール

キーワード

検索結果

<< < 1 2 3 4 > >>

Kernel.#exec(program, *args, options={}) -> () (14.0)

引数で指定されたコマンドを実行します。

...スクリプタなど)引き継ぎます。
Hash を options として渡すことで、この挙動を変更できます。
詳しくは Kernel.#spawn を参照してください。

=== 引数の解釈

この形式で呼び出した場合、空白や shell のメタキャラクタも
そのまま...
...替えて以下を実行
$ ps aux|grep sleep
xxxx 32754 0.0 0.0 2580 468 pts/3 S+ 22:01 0:00 mysleep 600
xxxx 32761 0.0 0.0 2824 792 pts/6 S+ 22:01 0:00 grep sleep

@see Kernel.#system,Kernel.#`,Kernel.#spawn,Kernel.#fork,IO.popen,IO.pipe,Kernel.#open,exec(3)...

IO.popen("-", mode = "r", opt={}) -> IO (11.0)

第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。

...put: foo\n"

opt ではエンコーディングの設定やプロセス起動のためのオプションが指定できます。
IO.new や Kernel.#spawn で指定できるものと共通なので
詳しくはそちらを見てください。

@param env 環境変数を { 変数名 => 内容 } と...

IO.popen("-", mode = "r", opt={}) {|io| ... } -> object (11.0)

第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。

...put: foo\n"

opt ではエンコーディングの設定やプロセス起動のためのオプションが指定できます。
IO.new や Kernel.#spawn で指定できるものと共通なので
詳しくはそちらを見てください。

@param env 環境変数を { 変数名 => 内容 } と...

IO.popen(env, "-", mode = "r", opt={}) -> IO (11.0)

第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。

...put: foo\n"

opt ではエンコーディングの設定やプロセス起動のためのオプションが指定できます。
IO.new や Kernel.#spawn で指定できるものと共通なので
詳しくはそちらを見てください。

@param env 環境変数を { 変数名 => 内容 } と...

IO.popen(env, "-", mode = "r", opt={}) {|io| ... } -> object (11.0)

第一引数に文字列 "-" が指定された時、fork(2) を 行い子プロセスの標準入出力との間にパイプラインを確立します。 親プロセスでは IO オブジェクトを返し、子プロセスでは nil を返します。

...put: foo\n"

opt ではエンコーディングの設定やプロセス起動のためのオプションが指定できます。
IO.new や Kernel.#spawn で指定できるものと共通なので
詳しくはそちらを見てください。

@param env 環境変数を { 変数名 => 内容 } と...

絞り込み条件を変える

Kernel.#system(command, options={}) -> bool | nil (10.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...文字列で指定します。
@param env 更新する環境変数を表す Hash
@param options オプションパラメータ Hash

//emlist[シェル経由でコマンドを実行][ruby]{
system("echo *") # => true
# fileA fileB fileC ...
//}


@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...
...# => Errno::ENOENT (No such file or directory - sad)
system('ruby -e "exit(false)"', exception: true) # => RuntimeError (Command failed with exit 1: ruby -e "exit(false)")
system('ruby -e "exit(true)"', exception: true) # => true
//}

@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...

Kernel.#system(env, command, options={}) -> bool | nil (10.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...文字列で指定します。
@param env 更新する環境変数を表す Hash
@param options オプションパラメータ Hash

//emlist[シェル経由でコマンドを実行][ruby]{
system("echo *") # => true
# fileA fileB fileC ...
//}


@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...
...# => Errno::ENOENT (No such file or directory - sad)
system('ruby -e "exit(false)"', exception: true) # => RuntimeError (Command failed with exit 1: ruby -e "exit(false)")
system('ruby -e "exit(true)"', exception: true) # => true
//}

@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...

Kernel.#`(command) -> String (8.0)

command を外部コマンドとして実行し、その標準出力を文字列として 返します。このメソッドは `command` の形式で呼ばれます。

...Errno::EXXX コマンドを実行できないときや失敗した場合に発生します。

//emlist[例][ruby]{
puts `ruby -v` #=> ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
puts $?.inspect #=> #<Process::Status: pid=3580,exited(0)>
//}

@see Kernel.#system,Kernel.#exec,Kernel.#spawn...

Process.last_status -> Process::Status | nil (8.0)

カレントスレッドで最後に終了した子プロセスのステータスを返します。

...レッドで最後に終了した子プロセスのステータスを返します。

変数 $? の値と同じです。

Process.wait Process.spawn("ruby", "-e", "exit 13")
Process.last_status # => #<Process::Status: pid 4825 exit 13>

カレントスレッドで子プロセスを実行し...

Kernel.#exec(command, options={}) -> () (4.0)

引数で指定されたコマンドを実行します。

引数で指定されたコマンドを実行します。

プロセスの実行コードはそのコマンド(あるいは shell)になるので、
起動に成功した場合、このメソッドからは戻りません。

=== 引数の解釈

この形式では command が shell のメタ文字
//emlist{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行されます。

@param command コマンドを文字列で指定します。
@param env 更新する環境変数を表す Hash
@param options...

絞り込み条件を変える

<< < 1 2 3 4 > >>