60件ヒット
[1-60件を表示]
(0.091秒)
クラス
-
Shell
:: Filter (60)
検索結果
先頭5件
-
Shell
:: Filter # cat(*files) -> Shell :: Filter (24515.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
:: Filter # concat(*jobs) -> Shell :: Concat (12202.0) -
@todo
@todo -
Shell
:: Filter # truncate(path , length) -> 0 (12102.0) -
File クラスにある同名のクラスメソッドと同じです.
...File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate... -
Shell
:: Filter # tee(file) -> Shell :: Filter (6408.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...する Filter オブジェクトを返します.
@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
:: Filter # |(filter) -> object (6274.0) -
パイプ結合を filter に対して行います。
...パイプ結合を filter に対して行います。
@param filter Shell::Filter オブジェクトを指定します。
@return filter を返します。
使用例
require 'shell'
Shell.def_system_command("tail")
Shell.def_system_command("head")
Shell.def_system_command("wc")
sh = Sh......ell.new
sh.transact {
i = 1
while i <= (cat("/etc/passwd") | wc("-l")).to_s.chomp.to_i
puts (cat("/etc/passwd") | head("-n #{i}") | tail("-n 1")).to_s
i += 1
end
}... -
Shell
:: Filter # each(rs = nil) -> () (6208.0) -
フィルタの一行ずつをblockに渡します。
...行ずつをblockに渡します。
@param rs レコードセパレーターを表す文字列を指定します。
nil ならば、Shell.record_separatorの値が使用されます。
使用例
require 'shell'
sh = Shell.new
sh.cat("/etc/passwd").each { |line|
puts line
}... -
Shell
:: Filter # echo(*strings) -> Shell :: Filter (6208.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...ilter オブジェクトを返します.
@param strings シェルコマンド echo に与える引数を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(fi......le).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}... -
Shell
:: Filter # glob(pattern) -> Shell :: Filter (6208.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
..., それらを内容とする Filter オブジェクトを返します.
@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、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"
}
}
}
@see Dir.[]... -
Shell
:: Filter # to _ a -> [String] (6208.0) -
実行結果を文字列の配列で返します。
...実行結果を文字列の配列で返します。
require 'shell'
Shell.def_system_command("wc")
sh = Shell.new
puts sh.cat("/etc/passwd").to_a... -
Shell
:: Filter # to _ s -> String (6208.0) -
実行結果を文字列で返します。
...実行結果を文字列で返します。
require 'shell'
Shell.def_system_command("wc")
sh = Shell.new
sh.transact {
puts (cat("/etc/passwd") | wc("-l")).to_s
}...