るりまサーチ

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

別のキーワード

  1. _builtin each
  2. _builtin each_line
  3. prime each
  4. each
  5. tsort tsort_each

ライブラリ

キーワード

検索結果

Shell#foreach(path = nil, &block) -> () (6108.0)

pathがファイルなら, File#foreach pathがディレクトリなら, Dir#foreach の動作をします。

...イルなら, File#foreach
pathがディレクトリなら, Dir#foreach
の動作をします。

@
param path ファイルもしくはディレクトリのパスを文字列で指定します。

使用例
require 'shell'
Shell
.verbose = false
sh = Shell.new
sh.foreach("/tmp"){|f|
puts f...

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

実行すると, それらを内容とする 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#cat(*files) -> Shell::Filter (20.0)

実行すると, それらを内容とする 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|...

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

実行すると, それらを内容とする 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(file).each { |l|
e...

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

実行すると, それらを内容とする 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|...

絞り込み条件を変える