るりまサーチ

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

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file path
  4. file open
  5. file size

ライブラリ

キーワード

検索結果

<< < ... 2 3 4 >>

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

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

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

//emlist[exceptionオプションを指定][ruby]{
system("sad", exception: true) # => 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 (8.0)

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

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

//emlist[exceptionオプションを指定][ruby]{
system("sad", exception: true) # => 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, program, *args, options={}) -> bool | nil (3.0)

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

...umask
* 子プロセスでのリダイレクト
などを変更できます。環境変数のクリアなども指定できます。
詳しくは Kernel.#spawn を参照してください。

=== 引数の解釈

この形式で呼び出した場合、空白や shell のメタキャラクタも...
...se RuntimeError exception: true が指定されていて、コマンドの終了ステータスが 0 以外のときに発生します。

//emlist[インタプリタから直接コマンドを実行][ruby]{
system("echo", "*") # => true
# *
//}

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

Kernel.#system(program, *args, options={}) -> bool | nil (3.0)

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

...umask
* 子プロセスでのリダイレクト
などを変更できます。環境変数のクリアなども指定できます。
詳しくは Kernel.#spawn を参照してください。

=== 引数の解釈

この形式で呼び出した場合、空白や shell のメタキャラクタも...
...se RuntimeError exception: true が指定されていて、コマンドの終了ステータスが 0 以外のときに発生します。

//emlist[インタプリタから直接コマンドを実行][ruby]{
system("echo", "*") # => true
# *
//}

@see Kernel.#`,Kernel.#spawn,Kernel.#exec,system(3)...
<< < ... 2 3 4 >>