42件ヒット
[1-42件を表示]
(0.015秒)
種類
- インスタンスメソッド (36)
- 特異メソッド (6)
ライブラリ
- shell (6)
-
shell
/ command-processor (36)
クラス
- Shell (6)
-
Shell
:: CommandProcessor (36)
検索結果
先頭5件
-
Shell
:: CommandProcessor # transact { . . . } -> object (21113.0) -
ブロック中で shell を self として実行します。
...ブロック中で shell を self として実行します。
例:
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact{
system("ls", "-l") | head > STDOUT
# transact の中では、
# sh.system("ls", "-l") | sh.head > STDOUT と同じとなる。
}... -
Shell
:: CommandProcessor # out(dev = STDOUT , &block) -> () (3022.0) -
Shell#transact を呼び出しその結果を dev に出力します。
...Shell#transact を呼び出しその結果を dev に出力します。
@param dev 出力先をIO オブジェクトなどで指定します。
@param block transact 内部で実行するシェルを指定します。
使用例:
require 'shell'
Shell.def_system_command("head")
sh = Shell... -
Shell
:: CommandProcessor # cat(*files) -> Shell :: Filter (3006.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...与えるファイル名を文字列で指定します。
動作例
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
:: CommandProcessor # echo(*strings) -> Shell :: Filter (3006.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...echo に与える引数を文字列で指定します。
動作例
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
:: CommandProcessor # glob(pattern) -> Shell :: Filter (3006.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...式については、Dir.[] を参照してください。
動作例
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
:: CommandProcessor # tee(file) -> Shell :: Filter (3006.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...与えるファイル名を文字列で指定します。
動作例
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
. undef _ system _ command(command) -> Shell :: CommandProcessor (106.0) -
commandを削除します.
...指定します。
動作例:
require 'shell'
Shell.def_system_command("ls")
# ls を定義
Shell.undef_system_command("ls")
# ls を 削除
sh = Shell.new
begin
sh.transact {
ls("-l").each {|l|
puts l
}
}
rescue NameError => err
puts err
end...