るりまサーチ

最速Rubyリファレンスマニュアル検索!
345件ヒット [1-100件を表示] (0.038秒)
トップページ > クエリ:path[x] > クエリ:system[x]

別のキーワード

  1. _builtin path
  2. pathname to_path
  3. _builtin absolute_path
  4. _builtin to_path
  5. pstore path

検索結果

<< 1 2 3 ... > >>

Kernel.#system(command, options={}) -> bool | nil (18137.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 (18137.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 (18127.0)

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

...り、第2要素が「みせかけ」のプロ
グラム名になります。
また、第1要素はフルパスで指定しなくても環境変数 PATH から探します。

@param program 文字列か2要素の配列です。
@param args program に渡す引数を 0 個以上指定する
@param...
...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 (18127.0)

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

...り、第2要素が「みせかけ」のプロ
グラム名になります。
また、第1要素はフルパスで指定しなくても環境変数 PATH から探します。

@param program 文字列か2要素の配列です。
@param args program に渡す引数を 0 個以上指定する
@param...
...se RuntimeError exception: true が指定されていて、コマンドの終了ステータスが 0 以外のときに発生します。

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

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

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

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

...り、第2要素が「みせかけ」のプロ
グラム名になります。
また、第1要素はフルパスで指定しなくても環境変数 PATH から探します。

@param program 文字列か2要素の配列です。
@param args program に渡す引数を 0 個以上指定する
@param...
...s オプションパラメータ Hash
@raise ArgumentError 第一引数が配列かつ要素数が 2 でない場合に発生します。

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

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

絞り込み条件を変える

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

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

...り、第2要素が「みせかけ」のプロ
グラム名になります。
また、第1要素はフルパスで指定しなくても環境変数 PATH から探します。

@param program 文字列か2要素の配列です。
@param args program に渡す引数を 0 個以上指定する
@param...
...s オプションパラメータ Hash
@raise ArgumentError 第一引数が配列かつ要素数が 2 でない場合に発生します。

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

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

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

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

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

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


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

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

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

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

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


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

Shell.default_system_path=(path) (12347.0)

Shellでもちいられるコマンドを検索する対象のパスを設定および、参照します。

...る対象のパスを設定および、参照します。

@param path Shellでもちいられるコマンドを検索する対象のパスを文字列で指定します。

動作例
require 'shell'
p Shell.default_system_path
# 例
#=> [ "/opt/local/bin", "/opt/local/sbin", "/usr/bin", "/...
...bin", "/usr/sbin", "/sbin", "/usr/local/bin", "/usr/X11/bin", "/Users/kouya/bin"]
Shell.default_system_path = ENV["HOME"] + "/bin"
p Shell.default_system_path
# => "/Users/kouya/bin"...

Shell#system_path=(path) (12335.0)

コマンドサーチパスの配列を返す。

...コマンドサーチパスの配列を返す。

@param path コマンドサーチパスの配列を指定します。

使用例

require 'shell'
sh = Shell.new
sh.system_path = [ "./" ]
p sh.system_path #=> ["./"]...

絞り込み条件を変える

Shell.default_system_path -> Array (12247.0)

Shellでもちいられるコマンドを検索する対象のパスを設定および、参照します。

...る対象のパスを設定および、参照します。

@param path Shellでもちいられるコマンドを検索する対象のパスを文字列で指定します。

動作例
require 'shell'
p Shell.default_system_path
# 例
#=> [ "/opt/local/bin", "/opt/local/sbin", "/usr/bin", "/...
...bin", "/usr/sbin", "/sbin", "/usr/local/bin", "/usr/X11/bin", "/Users/kouya/bin"]
Shell.default_system_path = ENV["HOME"] + "/bin"
p Shell.default_system_path
# => "/Users/kouya/bin"...

Shell#system_path -> Array (12235.0)

コマンドサーチパスの配列を返す。

...コマンドサーチパスの配列を返す。

@param path コマンドサーチパスの配列を指定します。

使用例

require 'shell'
sh = Shell.new
sh.system_path = [ "./" ]
p sh.system_path #=> ["./"]...

Shell.def_system_command(command, path = command) -> nil (6226.0)

Shell のメソッドとして command を登録します.

...す.
注) コマンドを定義しなくとも直接実行できる Shell#system コマンドもあります.

@param command Shell のメソッドとして定義するコマンドを文字列で指定します。

@param path command のパスを指定します。
指定しない場合...
...はcommand と同じになります。

例)
require 'shell'
Shell.def_system_command "ls"
# ls を定義

Shell.def_system_command "sys_sort", "sort"
# sortコマンドをsys_sortとして定義

sh = Shell.new
sh.transact {
ls.each { |l|
puts l
}
(ls("-l") | sys_sor...

Shell::CommandProcessor.def_system_command(command, path = command) -> () (6214.0)

@todo

...@todo

与えられたコマンドをメソッドとして定義します。

@param command 定義したいコマンドを指定します。

@param path command のパスを指定します。省略すると環境変数 PATH から command を探します。...

Shell.install_system_commands(pre = "sys_") -> () (6139.0)

system_path上にある全ての実行可能ファイルをShellに定義する. メソッ ド名は元のファイル名の頭にpreをつけたものとなる.

...
system
_path上にある全ての実行可能ファイルをShellに定義する. メソッ
ド名は元のファイル名の頭にpreをつけたものとなる.

@param pre Shellに定義するメソッド名の先頭に付加される文字列を指定します。

使用例: ls -l | head -n 5...
...のような例。

require 'shell'
Shell.install_system_commands
sh = Shell.new
sh.verbose = false
sh.transact {
(sys_ls("-l") | sys_head("-n 5")).each {|l|
puts l
}
}...

絞り込み条件を変える

Win32::Resolv.#get_hosts_path -> String | nil (6113.0)

hosts ファイルのパスを返します。ファイルが存在しない場合は nil を返します。

...hosts ファイルのパスを返します。ファイルが存在しない場合は nil を返します。

例:

require "win32/resolv"
p Win32::Resolv.get_hosts_path #=> "C:\Windows\System32\drivers\etc\hosts"...

Dir.new(path, encoding: Encoding.find("filesystem")) -> Dir (228.0)

path に対するディレクトリストリームをオープンして返します。

...
path
に対するディレクトリストリームをオープンして返します。

ブロックを指定して呼び出した場合は、ディレクトリストリームを
引数としてブロックを実行します。ブロックの実行が終了すると、
ディレクトリは自動...
...的にクローズされます。
ブロックの実行結果を返します。

@param path ディレクトリのパスを文字列で指定します。

@param encoding ディレクトリのエンコーディングを文字列か
Encoding オブジェクトで指定します。省...
<< 1 2 3 ... > >>