るりまサーチ

最速Rubyリファレンスマニュアル検索!
54件ヒット [1-54件を表示] (0.097秒)
トップページ > クエリ:t[x] > クエリ:@[x] > 種類:インスタンスメソッド[x] > クラス:Shell[x] > ライブラリ:shell[x] > クエリ:system[x]

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

キーワード

検索結果

Shell#system(command, *opts) -> Shell::SystemCommand (24435.0)

command を実行する.

...る.

@
param command 実行するコマンドのパスを文字列で指定します。

@
param opts command のオプションを文字列で指定します。複数可。

使用例:

require 'shell'
Shell
.verbose = false
sh = Shell.new

print sh.system("ls", "-l")
Shell
.def_system_comma...
...nd("head")
sh.system("ls", "-l") | sh.head("-n 3") > STDOUT...

Shell#system_path -> Array (12224.0)

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

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

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

使用例

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

Shell#system_path=(path) (12224.0)

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

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

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

使用例

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

Shell#find_system_command(command) (12221.0)

@todo

...@todo...

Shell#tee(file) -> Shell::Filter (6216.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...lter オブジェクトを返します.

@
param file シェルコマンドtee に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell
.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat...
...(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}...

絞り込み条件を変える

Shell#out(dev = STDOUT, &block) -> () (6128.0)

Shell#transact を呼び出しその結果を dev に出力します。

...
Shell
#transact を呼び出しその結果を dev に出力します。

@
param dev 出力先をIO オブジェクトなどで指定します。

@
param block transact 内部で実行するシェルを指定します。


使用例:
require 'shell'
Shell
.def_system_command("head")
sh = Shell...
....new
File.open("out.txt", "w"){ |fp|
sh.out(fp) {
system
("ls", "-l") | head("-n 3")
}
}...

Shell#cat(*files) -> Shell::Filter (6116.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...を内容とする Filter オブジェクトを返します.

@
param files シェルコマンド cat に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell
.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|...
...file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}...

Shell#glob(pattern) -> Shell::Filter (122.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...Filter オブジェクトを返します.

@
param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、Dir.[] を参照してください。

動作例
require 'shell'
Shell
.def_system_command("head")
sh = Shell.n...
...ew
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}

@
see Dir.[]...

Shell#echo(*strings) -> Shell::Filter (116.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...Filter オブジェクトを返します.

@
param strings シェルコマンド echo に与える引数を文字列で指定します。

動作例
require 'shell'
Shell
.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(f...
...ile).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}...